Expressions¶
ironArray has a strong support for expression evaluation. Things like sums, products, divisions and a pretty complete range of transcendental functions (e.g. exp, sin, asin, tanh…) have been implemented so as to guarantee an efficient evaluation in (large) arrays.
Expressions can be built either from small one liners (either in string format or as regular Python expressions, see tutorials section for details), or from User Defined Functions which are described later in section User Defined Functions. There are the next constructors for creating an expression:
Constructors¶
Create an |
|
Create an |
Expressions are implemented in the iarray.Expr
class. Once built,
they can be evaluated via the iarray.Expr.eval()
method.
Expressions can call UDF functions registered via the
iarray.UdfRegistry
class.
Methods¶
Evaluate the expression in self. |
UdfRegistry¶
This class is meant to register UDF functions in libraries. As there is only a global register, the user must use its global udf_registry instance in the iarray package.
Note that, since the inclusion of the new lib= param in the udf.scalar decorator, it is not necessary to use this explicitly for registering anymore. See udf_expr.py example for more info on how to use the register mechanism.
Methods |
Methods¶
Get the |
|
Add a UDF function to |
|
Delete the attr given by |
|
Iterate over all UDF funcs registered in |
|
Iterate over all UDF func names registered in all libs. |
|
Return the address of the compiled UDF function. |
|
Clear all the registered libs and UDF funcs. |
Utils¶
Return a tuple with the operands of an expression in string form. |
|
Return the operands and functions of an expression in string form. |