andes.core.param.IdxParam#
- class andes.core.param.IdxParam(default: float | str | int | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: str | None = None, iconvert: Callable | None = None, oconvert: Callable | None = None)[source]#
An alias of BaseParam with an additional storage of the owner model name
This class is intended for storing idx into other models. It can be used in the future for data consistency check.
Notes
This will be useful when, for example, one connects two TGs to one SynGen.
Examples
A PQ model connected to Bus model will have the following code
class PQModel(...): def __init__(...): ... self.bus = IdxParam(model='Bus')
- __init__(default: float | str | int | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: str | None = None, iconvert: Callable | None = None, oconvert: Callable | None = None)[source]#
Methods
add
([value])Add a new parameter value (from a new device of the owner model) to the
v
list.Return
self.name
in a list.get_property
(property_name)Check the boolean value of the given property.
set
(pos, attr, value)Set attributes of the BaseParam class to new values at the given positions.
set_all
(attr, value)Set attributes of the BaseParam class to new values for all positions.
Attributes
Return the class name.
Return the count of elements in the value array.