andes.core.param.IdxParam#

class andes.core.param.IdxParam(default: Optional[Union[float, str, int]] = None, name: Optional[str] = None, tex_name: Optional[str] = None, info: Optional[str] = None, unit: Optional[str] = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: Optional[str] = None, iconvert: Optional[Callable] = None, oconvert: Optional[Callable] = 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: Optional[Union[float, str, int]] = None, name: Optional[str] = None, tex_name: Optional[str] = None, info: Optional[str] = None, unit: Optional[str] = None, mandatory: bool = False, unique: bool = False, export: bool = True, model: Optional[str] = None, iconvert: Optional[Callable] = None, oconvert: Optional[Callable] = None)[source]#

Methods

add([value])

Add a new parameter value (from a new device of the owner model) to the v list.

get_names()

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

class_name

Return the class name.

n

Return the count of elements in the value array.