ams.core.service.NumOp#
- class ams.core.service.NumOp(u: Callable, fun: Callable, args: dict = None, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, expand_dims: int = None, array_out=True, no_parse: bool = False, sparse: bool = False)[source]#
Perform an operation on a numerical array using the function
fun(u.v, **args).Note that the scalar output is converted to a 1D array.
The rargs are passed to the input function.
- Parameters:
- uCallable
Input.
- namestr, optional
Instance name.
- tex_namestr, optional
TeX name.
- unitstr, optional
Unit.
- infostr, optional
Description.
- vtypeType, optional
Variable type.
- modelstr, optional
Model name.
- rfunCallable, optional
Function to apply to the output of
fun.- rargsdict, optional
Keyword arguments to pass to
rfun.- expand_dimsint, optional
Expand the dimensions of the output array along a specified axis.
- array_outbool, optional
Whether to force the output to be an array.
- sparse: bool, optional
True to return output as scipy csr_matrix.
- __init__(u: Callable, fun: Callable, args: dict = None, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, expand_dims: int = None, array_out=True, no_parse: bool = False, sparse: bool = False)[source]#
Methods
Assign memory for
self.vand set the array to zero.evaluate(*args, **kwargs)Return all the indexes of this item.
get_idx()Return name in a list
parse(*args, **kwargs)update()Update the Parameter value.
Attributes