We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following numpy functions are tested by creating UDF definitions taking with scalar inputs.
np.sin(x)
np.cos(x)
np.tan(x)
np.arcsin(x)
np.arccos(x)
np.arctan(x)
np.hypot(x,y)
np.arctan2(x,y)
np.radians
np.degrees
np.deg2rad
np.rad2deg
np.sinh(x)
np.cosh(x)
np.tanh(x)
np.arcsinh(x)
np.arccosh(x)
np.arctanh(x)
np.around(a)
np.round_(a)
np.rint(x)
np.fix(x)
np.floor(x)
np.ceil(x)
np.trunc(x)
np.spacing(x)
np.nextafter(x, y)
np.prod(x)
np.sum(x)
Needs support for returning an omnisci array
np.nanprod(x)
np.nansum(x)
np.cumprod(x)
np.cumsum(x)
np.nancumprod(x)
np.nancumsum(x)
np.diff(x)
np.ediff1d(x)
np.gradient(x)
np.cross(x)
np.trapz(x)
np.exp(x)
np.expm1(x)
np.exp2(x)
np.log(x)
np.log10(x)
np.log2(x)
np.log1p(x)
np.logaddexp(x, y)
np.logaddexp2(x, y)
np.frexp
(<float>, <int>)
np.ldexp(x)
np.lcm(x1, x2)
np.gcd(x1, x2)
np.left_shift(x1, x2)
np.right_shift(x1, x2)
np.absolute(x)
np.conjugate(x)
np.fabs(x)
np.fmin(x, y)
np.fmax(x, y)
np.minimum(x, y)
np.maximum(x, y)
np.negative(x)
np.positive(x)
np.sign(x)
np.reciprocal(x)
np.add(x1, x2)
np.subtract(x1, x2)
np.multiply(x1, x2)
np.divide(x1, x2)
np.true_divide(x1, x2)
np.floor_divide(x1, x2)
np.power(x1, x2)
np.float_power(x1, x2)
np.square(x)
np.sqrt(x)
np.cbrt(x)
np.remainder(x1, x2)
np.fmod(x1, x2)
np.mod(x1, x2)
np.modf(x)
np.divmod(x1, x2)
tuple
np.copysign(x, y)
np.heaviside(x, y)
no_python
np.isfinite(x)
np.isinf(x)
np.isnan(x)
np.isnat(x)
np.signbit(x)
np.less(x, y)
np.less_equal(x, y)
np.greater(x, y)
np.greater_equal(x, y)
np.equal(x, y)
np.not_equal(x, y)
np.logical_not(x)
np.logical_or(x, y)
np.logical_xor(x, y)
np.logical_and(x, y)
The following names cannot be used as the names of UDF function definitions:
fmod
sinh
cosh
tanh
rint
trunc
expm1
exp2
log2
log1p
gcd
lcm
around
hypot
https://github.com/omnisci/omniscidb-internal/pull/4133 removes the above restriction.
The text was updated successfully, but these errors were encountered:
We need to test if those functions works when applied to an array. For instance:
@omnisci(double[](int64)) def apply_sin(size): arr = Array(size, 'double') for i in range(size): arr[i] = nb_types.double(i) return np.sin(arr) query = 'select apply_sin(5);` result, _ = omni.sql_execute(query) out = list(result)[0] print(out) # should print [ 0. , 0.84147098, 0.90929743, 0.14112001, -0.7568025 ]
Edit: They do not work on arrays.
Sorry, something went wrong.
Closing this issue in favor of #31
I will re-open this issue and update it to contain a table of math functions we support on CPU and CUDA.
Closing again in favor of #31
guilhermeleobas
No branches or pull requests
The following numpy functions are tested by creating UDF definitions taking with scalar inputs.
Trigonometric functions
np.sin(x)
np.cos(x)
np.tan(x)
np.arcsin(x)
np.arccos(x)
np.arctan(x)
np.hypot(x,y)
- see forbidden name section belownp.arctan2(x,y)
np.radians
np.degrees
np.deg2rad
np.rad2deg
Hyperbolic functions
np.sinh(x)
- see forbidden name section belownp.cosh(x)
- see forbidden name section belownp.tanh(x)
- see forbidden name section belownp.arcsinh(x)
np.arccosh(x)
np.arctanh(x)
Rounding
np.around(a)
np.round_(a)
- see forbidden name section belownp.rint(x)
- see forbidden name section belownp.fix(x)
- not supported by Numbanp.floor(x)
np.ceil(x)
np.trunc(x)
- see forbidden name section belownp.rint(x)
np.spacing(x)
np.nextafter(x, y)
Sums, products, differences
Needs a better list/array support.
np.prod(x)
np.sum(x)
Needs support for returning an omnisci array
np.nanprod(x)
np.nansum(x)
np.cumprod(x)
np.cumsum(x)
np.nancumprod(x)
np.nancumsum(x)
np.diff(x)
np.ediff1d(x)
np.gradient(x)
np.cross(x)
np.trapz(x)
Exponents and logarithms
np.exp(x)
np.expm1(x)
- see forbidden name section belownp.exp2(x)
- see forbidden name section belownp.log(x)
np.log10(x)
np.log2(x)
- see forbidden name section belownp.log1p(x)
- see forbidden name section belownp.logaddexp(x, y)
np.logaddexp2(x, y)
np.frexp
- not supported by Numba, returns(<float>, <int>)
np.ldexp(x)
Rational routines
np.lcm(x1, x2)
- see forbidden name section belownp.gcd(x1, x2)
- see forbidden name section belownp.left_shift(x1, x2)
np.right_shift(x1, x2)
Arithmetic operations
np.absolute(x)
np.conjugate(x)
np.fabs(x)
np.fmin(x, y)
np.fmax(x, y)
np.minimum(x, y)
np.maximum(x, y)
np.negative(x)
np.positive(x)
- not supported by Numbanp.sign(x)
np.reciprocal(x)
np.add(x1, x2)
np.subtract(x1, x2)
np.multiply(x1, x2)
np.divide(x1, x2)
np.true_divide(x1, x2)
np.floor_divide(x1, x2)
np.power(x1, x2)
np.float_power(x1, x2)
- not supported by Numbanp.square(x)
np.sqrt(x)
np.cbrt(x)
- not supported by Numba, np.cbrt cannot support in nopython mode numba/numba#5385np.remainder(x1, x2)
np.fmod(x1, x2)
np.mod(x1, x2)
np.modf(x)
np.divmod(x1, x2)
- not supported by Numba, returnstuple
np.copysign(x, y)
np.heaviside(x, y)
- not supported by Numba, np.heaviside inno_python
mode numba/numba#4706Logical functions
np.isfinite(x)
np.isinf(x)
np.isnan(x)
np.isnat(x)
np.signbit(x)
np.less(x, y)
np.less_equal(x, y)
np.greater(x, y)
np.greater_equal(x, y)
np.equal(x, y)
np.not_equal(x, y)
np.logical_not(x)
np.logical_or(x, y)
np.logical_xor(x, y)
np.logical_and(x, y)
Forbidden UDF names (OmnisciDB 5.1 or earlier)
The following names cannot be used as the names of UDF function definitions:
fmod
sinh
cosh
tanh
rint
trunc
expm1
exp2
log2
log1p
gcd
lcm
around
hypot
https://github.com/omnisci/omniscidb-internal/pull/4133 removes the above restriction.
The text was updated successfully, but these errors were encountered: