IscGroup
- class ipsa.IscGroup
The IscGroup class provides access to an IPSA group to set and get group members. Note the extension functions will only work for general groups and may not function for other groups e.g., areas, transformer groups.
- GetName() str
Returns the user defined group name as a string.
- Returns:
The user defined group name.
- Return type:
- SetName(strName: str) None
Sets the name as a string.
- Parameters:
strName (str) – The selected string name.
- GetGroupType() int
Returns the type of the group where:
0 = No group type
1 = Area type group – contains all busbars in an area
2 = Mixed item group
3 = Load scaling group
4 = Load transfer group
5 = Protection device group
8 = Generator scaling group
9 = Region group
10 = Transformer group (master slave operation)
11 = Feeder group
- Returns:
The group type.
- Return type:
- SetMembers(nUIDs: List[int]) bool
Overwrites the current list of group members with the given list of component UIDs. This replaces any existing members with the supplied list of UIDs.
NB. The user may not set the members of a Feeder group.
- ClearMembers() bool
Sets the group members to an empty list. This clears any existing members.
NB. The user may not clear the members of a Feeder group.
- Returns:
True if the members have been set.
- Return type:
- AddMember(nUID: int) bool
Appends the component with the given UID to the list of component UIDs if the UID is not present. All existing group member UIDs are unaffected.
NB. The user may not add members to a Feeder group.
- RemoveMember(nUID: int) bool
Removes the component with the given UID from the list of component UIDs if the UID is present. All other existing group member UIDs are unaffected.
NB. The user may not remove members from a Feeder group.
- IsMember(nUID: int) bool
Checks whether the component with the given UID is present in the list of component UIDs. The list of group member UIDs will be unaffected.
- CompareGroups(nGroupUID: int, bUseIntersection: bool = False) List[int]
Compares the current group with the group with UID given by nGroupUID. By default, will perform a difference operation returning a list of component UIDs present in the current group but not present in the group with UID given by nGroupUID. If bUseIntersection is True it will return a list of component UIDs present in both lists. Both lists of group member UIDs will be unaffected.
- MergeGroups(nGroupUID: int, bDeleteGroup: bool = False) bool
Appends the list of component UIDs from the group with the given UID onto the current group’s UID list. By default the group with the given UID will be unnaffected, unless bDeleteGroup is True, in which case it will be deleted.
- GetLoadScalingReal() float
Returns the per unit scaling factor on the active power for the loads in the group. NB. This will only work for load scaling groups.
- Returns:
The per unit scaling factor for the load active power.
- Return type:
- GetLoadScalingReactive() float
Returns the per unit scaling factor on the reactive power for the loads in the group. NB. This will only work for load scaling groups.
- Returns:
The per unit scaling factor for the load reactive power.
- Return type:
- SetLoadScaling(fRealScale: float, fReactiveScale: float) bool
Sets the per unit scaling factors for the active and reactive parts of the loads in the group. NB. This will only work for load scaling groups.
- GetGeneratorScalingReal() float
Returns the per unit scaling factor on the active power for the generators in the group. NB. This will only work for generator scaling groups.
- Returns:
The per unit scaling factor for the generator active power.
- Return type:
- GetGeneratorScalingReactive() float
Returns the per unit scaling factor on the reactive power for the generators in the group. NB. This will only work for generator scaling groups.
- Returns:
The per unit scaling factor for the generator reactive power.
- Return type:
- SetGeneratorScaling(fRealScale: float, fReactiveScale: float) bool
Sets the per unit scaling factors for the active and reactive parts of the generators in the group. NB. This will only work for generator scaling groups.
- GetFeederScalingActive() bool
Returns whether the group feeder active and reactive scaling is in use. NB. This will only work for feeder groups.
- Returns:
True if the group feeder scaling is active.
- Return type:
- SetFeederScalingActive(bUseFeederScaling) bool
Sets whether the group feeder active and reactive scaling is in use. NB. This will only work for feeder groups.
- GetFeederScalingReal() float
Returns the per unit scaling factor on the active power for the feeder group. NB. This will only work for feeder groups.
- Returns:
The per unit scaling factor for the active power.
- Return type:
- GetFeederScalingReactive() float
Returns the per unit scaling factor on the reactive power for the feeder group. NB. This will only work for feeder groups.
- Returns:
The per unit scaling factor for the reactive power.
- Return type:
- SetFeederScaling(fRealScale: float, fReactiveScale: float) bool
Sets the per unit scaling factors for the active and reactive parts for the feeder group. NB. This will only work for feeder groups.
- AddDataExtension(strName: str, default: int | float | str | bool) int
Adds an integer/float/string/double extension data field and returns the new field index. Sets the default value.
This only has to be called once per component type - not for every instance of the component!
Note: The variable of the function is not called default.
You can use either nDefault, dDefault, strDefault or bDefault to specify the default value depending on the type of data extension being added.
- AddListIntDataExtension(strName: str) int
Adds a data field for a list of integers and returns the new field index. Sets the default value to an empty list.
This only has to be called once per component type - not for every instance of the component!
- AddListDblDataExtension(strName: str) int
Adds a data field for a list of doubles and returns the new field index. Sets the default value to an empty list.
This only has to be called once per component type - not for every instance of the component!
- AddListStrDataExtension(strName: str) int
Adds a data field for a list of strings and returns the new field index. Sets the default value to an empty list.
This only has to be called once per component type - not for every instance of the component!
- DeleteDataExtensionField(nFieldIndex: int) bool
- DeleteDataExtensionField(strName: str) bool
Deletes the extension field identified by the name strName or index nFieldIndex. This will delete the data in this extension field from this group and all other groups of the same type. It is advised to call NonDefaultExtensionInstanceCount prior to deleting the data extension field to ensure the expected amount of data shall be deleted.
This only has to be called once per component type - not for every instance of the component!
- NonDefaultExtensionInstanceCount(nFieldIndex: int) int
- NonDefaultExtensionInstanceCount(strName: str) int
Returns the number of groups of the same type where the extension field identified by strName or nFieldIndex is set to a non-default value. That is, the count of the components where data will be destroyed by calling DeleteDataExtensionField.
- GetListIntExtensionValue(nFieldIndex: int, nIndex: int) int
Get a single integer value from the list within the given enumerated field.
Note, the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- GetListDblExtensionValue(nFieldIndex: int, nIndex: int) float
Get a single float value from the list within the given enumerated field.
Note, the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- GetListStrExtensionValue(nFieldIndex: int, nIndex: int) str
Get a single string value from the list within the given enumerated field.
Note, the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- GetListIntSize(nFieldIndex: int) int
Gets the size of the list of integers for the given enumerated field.
- GetListDblSize(nFieldIndex: int) int
Gets the size of the list of doubles for the given enumerated field.
- GetListStrSize(nFieldIndex: int) int
Gets the size of the list of strings for the given enumerated field.
- SetIntExtensionValue(nFieldIndex: int, nValue: int) bool
Set the integer value for the given extension field.
- SetDblExtensionValue(nFieldIndex: int, dValue: float) bool
Set the float value for the given extension field.
- SetStrExtensionValue(nFieldIndex: int, sValue: str) bool
Set the string value for the given extension field.
- SetBoolExtensionValue(nFieldIndex: int, bValue: bool) bool
Set the boolean value for the given extension field.
- SetListIntExtensionValue(nFieldIndex: int, nIndex: int, nValue: int) bool
Sets the value of a specified element in a list of integers within the given enumerated field.
Note the index within the list, nIndex, must already exist - that is, the size of the list (i.e., GetListIntSize) must be larger than nIndex. Note also that the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- SetListDblExtensionValue(nFieldIndex: int, nIndex: int, dValue: float) bool
Sets the value of a specified element in a list of doubles within the given enumerated field.
Note the index within the list, nIndex, must already exist - that is, the size of the list (i.e., GetListDblSize) must be larger than nIndex. Note also that the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- SetListStrExtensionValue(nFieldIndex: int, nIndex: int, strValue: str) bool
Sets the value of a specific element in a list of strings within the given enumerated field.
Note the index within the list, nIndex, must already exist - that is, the size of the list (i.e., GetListStrSize) must be larger than nIndex. Note also that the PyIPSA nIndex starts from 0, while the UI index starts from 1.
- PushBackListIntExtensionValue(nFieldIndex: int, nValue: int) bool
Adds an item with the given value to the end of a list of integers within the given enumerated field.
- PushBackListDblExtensionValue(nFieldIndex: int, dValue: float) bool
Adds an item with the given value to the end of a list of doubles within the given enumerated field.
- PushBackListStrExtensionValue(nFieldIndex: int, strValue: str) bool
Adds an item with the given value to the end of a list of strings within the given enumerated field.
- GetExtensionFieldIndex(strName: str) int
Returns the field index for the extended data field of a specified name.
- GetExtensionNames() Dict[int, str]
Returns a dictionary of extension field indexes and field names. The dictionary keys are integers representing all the extended data fields. The dictionary values are the field names of the individual extended data fields. Each extended data field is therefore represented by {nIndex:strName}, where integer nIndex is the field index and string strName is the field name.