andes.core.service.NumSelect#
- class andes.core.service.NumSelect(optional, fallback, name: str | None = None, tex_name: str | None = None, info: str | None = None, ignore_cond: ~typing.Callable | None = functools.partial(<ufunc 'equal'>, 0))[source]#
Class for selecting values for optional NumParam.
NumSelect works with internal and external parameters.
Any values equal to
np.nanwill always be ignored. If one needs to ignore values based on additional conditions, pass it throughignore_cond. For example, to ignore zero values, useignore_cond = partial(np.equal, 0).Examples
One use case is to allow an optional turbine rating. One can do
self.Tn = NumParam(default=None) self.Sg = ExtParam(...) self.Sn = DataSelect(Tn, Sg)
- __init__(optional, fallback, name: str | None = None, tex_name: str | None = None, info: str | None = None, ignore_cond: ~typing.Callable | None = functools.partial(<ufunc 'equal'>, 0))[source]#
Methods
assign_memory(n)Assign memory for
self.vand set the array to zero.get_names()Return name in a list
Attributes
class_nameReturn the class name
nReturn the count of values in
self.v.vReturn values stored in self._v.