Quiby functions are functions that have been modified to work directly on quib arguments. When a quiby function is applied on quib arguments, it creates a new quib, whose function is to perform the original function on the value of its quib arguments.
# Imports
import pyquibbler as qb
from pyquibbler import iquib
qb.initialize_quibbler(show_quibs_as_widgets=False)
import numpy as np
To check whether a given function is quiby, use is_quiby
.
For example, np.sin
is a quiby function:
qb.is_quiby(np.sin)
True
We can therefore use it directly on quib arguments:
x = iquib(1.5)
np.sin(x)
sin(x)
On the other hand, int
is not a quiby function:
qb.is_quiby(int)
False
Applying int
directly on a quib argument will raise an exception.
Note though that any non-quiby functions, like int
, or any user function can be converted be a quiby function using the function quiby
. See User-defined-functions
.
To see all available quiby functiuons, use list_quiby_funcs()
:
qb.list_quiby_funcs()
['None: <function identity_function at 0x7fb371188280>',
'None: <function proxy at 0x7fb371188700>',
'None: <function identity_function_obj2quib at 0x7fb3716f7010>',
'Quib: __add__',
'Quib: __sub__',
'Quib: __mul__',
'Quib: __truediv__',
'Quib: __floordiv__',
'Quib: __mod__',
'Quib: __pow__',
'Quib: __lshift__',
'Quib: __rshift__',
'Quib: __and__',
'Quib: __xor__',
'Quib: __or__',
'Quib: __radd__',
'Quib: __rsub__',
'Quib: __rmul__',
'Quib: __rtruediv__',
'Quib: __rfloordiv__',
'Quib: __rmod__',
'Quib: __rpow__',
'Quib: __rlshift__',
'Quib: __rrshift__',
'Quib: __rand__',
'Quib: __rxor__',
'Quib: __ror__',
'Quib: __ne__',
'Quib: __lt__',
'Quib: __gt__',
'Quib: __ge__',
'Quib: __le__',
'Quib: __matmul__',
'Quib: __neg__',
'Quib: __pos__',
'Quib: __abs__',
'Quib: __invert__',
'Quib: __round__',
'Quib: __trunc__',
'Quib: __floor__',
'Quib: __ceil__',
'Quib: __getitem__',
'Axes: plot',
'Axes: scatter',
'Axes: axvline',
'Axes: axhline',
'Arc: __new__',
'Arrow: __new__',
'ArrowStyle: __new__',
'BoxStyle: __new__',
'Circle: __new__',
'CirclePolygon: __new__',
'ConnectionPatch: __new__',
'ConnectionStyle: __new__',
'Ellipse: __new__',
'FancyArrow: __new__',
'FancyArrowPatch: __new__',
'FancyBboxPatch: __new__',
'Patch: __new__',
'RegularPolygon: __new__',
'Axes: acorr',
'Axes: angle_spectrum',
'Axes: annotate',
'Axes: arrow',
'Axes: axhspan',
'Axes: axline',
'Axes: axvspan',
'Axes: bar',
'Axes: barbs',
'Axes: barh',
'Axes: boxplot',
'Axes: broken_barh',
'Axes: cohere',
'Axes: contour',
'Axes: contourf',
'Axes: csd',
'Axes: errorbar',
'Axes: eventplot',
'Axes: fill',
'Axes: fill_between',
'Axes: fill_betweenx',
'Axes: hexbin',
'Axes: hist',
'Axes: hist2d',
'Axes: hlines',
'Axes: imshow',
'Axes: legend',
'Axes: loglog',
'Axes: magnitude_spectrum',
'Axes: matshow',
'Axes: pcolor',
'Axes: pcolormesh',
'Axes: phase_spectrum',
'Axes: pie',
'Axes: plot_date',
'Axes: psd',
'Axes: quiver',
'Axes: semilogx',
'Axes: semilogy',
'Axes: specgram',
'Axes: spy',
'Axes: stackplot',
'Axes: stairs',
'Axes: stem',
'Axes: step',
'Axes: streamplot',
'Axes: table',
'Axes3D: text2D',
'Axes: tricontour',
'Axes: tricontourf',
'Axes: tripcolor',
'Axes: triplot',
'Axes: violinplot',
'Axes: vlines',
'Axes: xcorr',
'Axes: set_alpha',
'Axes: set_aspect',
'Axes: set_facecolor',
'Axes: set_fc',
'Axes: set_position',
'Axes: set_title',
'Axes: set_visible',
'Axes: set_xlabel',
'Axes: set_xscale',
'Axes: set_xticklabels',
'Axes: set_xticks',
'Axes: set_ylabel',
'Axes: set_yscale',
'Axes: set_yticklabels',
'Axes: set_yticks',
'Axes: grid',
'Axes: bar_label',
'Axes: set_xlim',
'Axes: set_ylim',
'Axes3D: acorr',
'Axes3D: arrow',
'Axes3D: axhline',
'Axes3D: axhspan',
'Axes3D: axis',
'Axes3D: axline',
'Axes3D: axvline',
'Axes3D: axvspan',
'Axes3D: bar',
'Axes3D: bar3d',
'Axes3D: barbs',
'Axes3D: barh',
'Axes3D: boxplot',
'Axes3D: broken_barh',
'Axes3D: bxp',
'Axes3D: contour3D',
'Axes3D: contourf3D',
'Axes3D: csd',
'Axes3D: errorbar',
'Axes3D: eventplot',
'Axes3D: fill',
'Axes3D: fill_between',
'Axes3D: fill_betweenx',
'Axes3D: hist',
'Axes3D: hist2d',
'Axes3D: hlines',
'Axes3D: imshow',
'Axes3D: legend',
'Axes3D: loglog',
'Axes3D: matshow',
'Axes3D: pie',
'Axes3D: plot3D',
'Axes3D: plot_date',
'Axes3D: plot_surface',
'Axes3D: plot_trisurf',
'Axes3D: plot_wireframe',
'Axes3D: quiver3D',
'Axes3D: scatter3D',
'Axes3D: secondary_xaxis',
'Axes3D: secondary_yaxis',
'Axes3D: semilogx',
'Axes3D: semilogy',
'Axes3D: stackplot',
'Axes3D: stairs',
'Axes3D: stem3D',
'Axes3D: text3D',
'Axes3D: tricontour',
'Axes3D: tricontourf',
'Axes3D: tripcolor',
'Axes3D: triplot',
'Axes3D: tunit_cube',
'Axes3D: tunit_edges',
'Axes3D: violin',
'Axes3D: violinplot',
'Axes3D: vlines',
'Axes3D: voxels',
'matplotlib.widgets: RadioButtons',
'matplotlib.widgets: Slider',
'matplotlib.widgets: RangeSlider',
'matplotlib.widgets: CheckButtons',
'matplotlib.widgets: RectangleSelector',
'matplotlib.widgets: TextBox',
'matplotlib.image: imread',
'numpy: empty',
'numpy: empty_like',
'numpy: eye',
'numpy: identity',
'numpy: ones',
'numpy: ones_like',
'numpy: zeros',
'numpy: zeros_like',
'numpy: full',
'numpy: full_like',
'numpy: array',
'numpy: fromfile',
'numpy: arange',
'numpy: linspace',
'numpy: logspace',
'numpy: geomspace',
'numpy: meshgrid',
'numpy: mgrid',
'numpy: ogrid',
'numpy: diag',
'numpy: diagflat',
'numpy: tri',
'numpy: tril',
'numpy: triu',
'numpy: vander',
'numpy: shape',
'numpy: reshape',
'numpy: ravel',
'numpy: moveaxis',
'numpy: rollaxis',
'numpy: swapaxes',
'numpy: transpose',
'numpy: atleast_1d',
'numpy: atleast_2d',
'numpy: atleast_3d',
'numpy: broadcast_to',
'numpy: expand_dims',
'numpy: squeeze',
'numpy: asarray',
'numpy: concatenate',
'numpy: stack',
'numpy: row_stack',
'numpy: hstack',
'numpy: dstack',
'numpy: column_stack',
'numpy: tile',
'numpy: repeat',
'numpy: trim_zeros',
'numpy: unique',
'numpy: flip',
'numpy: fliplr',
'numpy: flipud',
'numpy: roll',
'numpy: rot90',
'numpy: invert',
'numpy: left_shift',
'numpy: right_shift',
'numpy: load',
'numpy: loadtxt',
'numpy: genfromtxt',
'numpy: array2string',
'numpy: dot',
'numpy: vdot',
'numpy: inner',
'numpy: outer',
'numpy: matmul',
'numpy: tensordot',
'numpy: einsum',
'numpy: kron',
'numpy: trace',
'numpy: all',
'numpy: any',
'numpy: isfinite',
'numpy: isinf',
'numpy: isnan',
'numpy: isnat',
'numpy: isneginf',
'numpy: isposinf',
'numpy: iscomplex',
'numpy: iscomplexobj',
'numpy: isreal',
'numpy: isrealobj',
'numpy: isscalar',
'numpy: logical_and',
'numpy: logical_or',
'numpy: logical_not',
'numpy: logical_xor',
'numpy: allclose',
'numpy: isclose',
'numpy: array_equal',
'numpy: array_equiv',
'numpy: greater',
'numpy: greater_equal',
'numpy: less',
'numpy: less_equal',
'numpy: equal',
'numpy: not_equal',
'numpy: sin',
'numpy: cos',
'numpy: tan',
'numpy: arcsin',
'numpy: arccos',
'numpy: arctan',
'numpy: hypot',
'numpy: arctan2',
'numpy: degrees',
'numpy: radians',
'numpy: unwrap',
'numpy: deg2rad',
'numpy: rad2deg',
'numpy: sinh',
'numpy: cosh',
'numpy: tanh',
'numpy: arcsinh',
'numpy: arccosh',
'numpy: arctanh',
'numpy: around',
'numpy: round',
'numpy: rint',
'numpy: fix',
'numpy: floor',
'numpy: ceil',
'numpy: trunc',
'numpy: prod',
'numpy: product',
'numpy: sum',
'numpy: nanprod',
'numpy: nansum',
'numpy: cumprod',
'numpy: cumproduct',
'numpy: cumsum',
'numpy: nancumprod',
'numpy: nancumsum',
'numpy: diff',
'numpy: ediff1d',
'numpy: exp',
'numpy: expm1',
'numpy: exp2',
'numpy: log',
'numpy: log10',
'numpy: log2',
'numpy: log1p',
'numpy: logaddexp',
'numpy: logaddexp2',
'numpy: i0',
'numpy: sinc',
'numpy: lcm',
'numpy: gcd',
'numpy: add',
'numpy: reciprocal',
'numpy: positive',
'numpy: negative',
'numpy: multiply',
'numpy: true_divide',
'numpy: power',
'numpy: subtract',
'numpy: floor_divide',
'numpy: float_power',
'numpy: fmod',
'numpy: remainder',
'numpy: modf',
'numpy: divmod',
'numpy: angle',
'numpy: real',
'numpy: imag',
'numpy: conjugate',
'numpy: maximum',
'numpy: fmax',
'numpy: max',
'numpy: nanmax',
'numpy: minimum',
'numpy: fmin',
'numpy: min',
'numpy: nanmin',
'numpy: sqrt',
'numpy: square',
'numpy: abs',
'numpy: sign',
'numpy: interp',
'numpy: polyval',
'numpy: polyfit',
'numpy.random: rand',
'numpy.random: randint',
'numpy.random: randn',
'numpy: in1d',
'numpy: intersect1d',
'numpy: isin',
'numpy: setdiff1d',
'numpy: setxor1d',
'numpy: union1d',
'numpy: sort',
'numpy: argsort',
'numpy: argmax',
'numpy: nanargmax',
'numpy: argmin',
'numpy: nanargmin',
'numpy: argwhere',
'numpy: nonzero',
'numpy: flatnonzero',
'numpy: where',
'numpy: searchsorted',
'numpy: extract',
'numpy: count_nonzero',
'numpy: ptp',
'numpy: percentile',
'numpy: nanpercentile',
'numpy: quantile',
'numpy: nanquantile',
'numpy: median',
'numpy: average',
'numpy: mean',
'numpy: std',
'numpy: var',
'numpy: nanmedian',
'numpy: nanmean',
'numpy: nanstd',
'numpy: nanvar',
'numpy: corrcoef',
'numpy: correlate',
'numpy: cov',
'numpy: histogram',
'numpy: histogram2d',
'numpy: histogramdd',
'numpy: bincount',
'numpy: histogram_bin_edges',
'numpy: digitize',
'numpy: bartlett',
'numpy: blackman',
'numpy: hamming',
'numpy: hanning',
'numpy: kaiser',
'numpy: diagonal',
'numpy: size',
'numpy: ndim',
'numpy: apply_along_axis',
'numpy: vectorize',
'Quib: get_override_mask',
'Quib: get_quiby_name',
'np.ndarray.T',
'np.ndarray.imag',
'np.ndarray.real',
'np.ndarray.ndim',
'np.ndarray.shape',
'np.ndarray.size',
'np.ndarray.all',
'np.ndarray.any',
'np.ndarray.argmax',
'np.ndarray.argmin',
'np.ndarray.conj',
'np.ndarray.conjugate',
'np.ndarray.cumprod',
'np.ndarray.cumsum',
'np.ndarray.diagonal',
'np.ndarray.flatten',
'np.ndarray.max',
'np.ndarray.mean',
'np.ndarray.min',
'np.ndarray.nonzero',
'np.ndarray.prod',
'np.ndarray.ptp',
'np.ndarray.ravel',
'np.ndarray.repeat',
'np.ndarray.reshape',
'np.ndarray.round',
'np.ndarray.squeeze',
'np.ndarray.std',
'np.ndarray.sum',
'np.ndarray.swapaxes',
'np.ndarray.tolist',
'np.ndarray.trace',
'np.ndarray.transpose',
'np.ndarray.var']