IscGroup

The IscGroup class provides access to all IPSA group types to get and set the group members and to modify group specific information.

Field Values

Get and Set functions through field index are only exposed for demand groups and fault level groups. The exposed field values are specific to the group type, so it is advised to always check group type before using the Get and Set functions to ensure the desired behaviour occurs.

IscGroup Field Values

Type

Field Name

Description

Float

FirmCapacityNonSeasonalMVA

Demand group property: The firm capacity non-seasonal apparent power in MVA.

Float

FirmCapacitySummerMVA

Demand group property: The firm capacity summer apparent power in MVA.

Float

FirmCapacityWinterMVA

Demand group property: The firm capacity winter apparent power in MVA.

Float

MaxLoadingNonSeasonalMVA

Demand group property: The maximum non-coincidental load non-seasonal apparent power in MVA.

Float

MaxLoadingSummerMVA

Demand group property: The maximum non-coincidental load summer apparent power in MVA.

Float

MaxLoadingWinterMVA

Demand group property: The maximum non-coincidental load winter apparent power in MVA.

Float

MaxLoadingNonSeasonalPowerFactor

Demand group property: The maximum non-coincidental load non-seasonal power factor.

Float

MaxLoadingSummerPowerFactor

Demand group property: The maximum non-coincidental load summer power factor.

Float

MaxLoadingWinterPowerFactor

Demand group property: The maximum non-coincidental load winter power factor.

String

FirmCapacityDescription

Demand group property: The firm capacity description.

String

MaxLoadingDescription

Demand group property: The maximum non-coincidental load description.

Integer

FaultKind

Fault level group property: Describes whether the fault level results are from a three-phase or single-phase fault.

  • 0 = Three-phase fault

  • 1 = Single-phase fault

Float

DCComponentkA

Fault level group property: The decaying (aperiodic) component of short-circuit current in kA. It is a mean value between the top and the bottom envelope of a short-circuit current decaying from an initial value to zero.

Float

InitSymmPowerMVA

Fault level group property: The initial symmetrical short-circuit power in MVA. It is a fictitious value determined as a product of the initial symmetrical short-circuit current, the nominal system voltage, and the factor square root of 3.

Float

InitSymmCurrentkA

Fault level group property: The initial symmetrical short-circuit current in kA. It is a root mean square (RMS) value of the alternate current (AC) symmetrical component of a prospective (available) short-circuit current, applicable at the instant of short circuit if the impedance remains at zero-time value.

Float

SymmBreakCurrentkA

Fault level group property: The symmetrical short-circuit breaking current in kA. It is an RMS value of an integral cycle of the symmetrical AC component of the prospective short-circuit current at the instant of contact separation of the first pole to open of a switching device.

Float

SymmBreakAngleDeg

Fault level group property: The symmetrical short-circuit breaking current angle in dgrees. It is the angle of an RMS value of an integral cycle of the symmetrical AC component of the prospective short-circuit current at the instant of contact separation of the first pole to open of a switching device.

Float

PeakCurrentkA

Fault level group property: The peak short-circuit current in kA. It is the maximum possible instantaneous value of prospective (available) short-circuit current.

Float

MaxSteadyCurrentkA

Fault level group property: The maximum steady state short-circuit current in kA.

Float

MinSteadyCurrentkA

Fault level group property: The minimum steady state short-circuit current in kA.

Float

SteadyCurrentkA

Fault level group property: The steady state short-circuit current in kA. It is an RMS value of the short-circuit current which remains after the decay of the transient phenomena.

Float

PosSeqResistanceOhm

Fault level group property: The resistance in Ohms of the positive-sequence system as viewed from the short-circuit location.

Float

PosSeqReactanceOhm

Fault level group property: The reactance in Ohms of the positive-sequence system as viewed from the short-circuit location.

Float

ZeroSeqResistanceOhm

Fault level group property: The resistance in Ohms of the zero-sequence system as viewed from the short-circuit location.

Float

ZeroSeqReactanceOhm

Fault level group property: The reactance in Ohms of the zero-sequence system as viewed from the short-circuit location.

String

FaultLevelDescription

Fault level group property: A description of the fault level analysis that produces the fault level results.

IscGroup Class

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.

GetUID() int

Returns the UID of the group.

Returns:

The group UID.

Return type:

int

GetName() str

Returns the user defined group name as a string.

Returns:

The user defined group name.

Return type:

str

SetName(strName: str) None

Sets the name as a string.

Parameters:

strName (str) – The selected string name.

GetFieldType(nFieldIndex: int) str

Returns the field type as a string for the enumerated field.

Parameters:

nFieldIndex (int) – The given enumerated field.

Returns:

The field type. The possible return values are ‘String’, ‘Integer’, ‘Float’ and ‘Boolean’.

Return type:

str

GetFieldName(nFieldIndex: int) str

Returns the field name as a string for the enumerated field.

Parameters:

nFieldIndex (int) – The given enumerated field.

Returns:

The field name.

Return type:

str

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

  • 12 = Demand group

  • 13 = Fault level group

Returns:

The group type.

Return type:

int

GetMembers() List[int]

Returns a list containing the UIDs of the components in the group.

Returns:

The UIDs of the components in the group.

Return type:

list(int)

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.

Parameters:

nUIDs (list(int)) – List of component integers.

Returns:

True if the members have been set.

Return type:

bool

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:

bool

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.

Parameters:

nUID (int) – Component UID.

Returns:

True if the members have been set.

Return type:

bool

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.

Parameters:

nUID (int) – Component UID.

Returns:

True if the members have been set.

Return type:

bool

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.

Parameters:

nUID (int) – Component UID.

Returns:

True if nUID is present in list of member UIDs.

Return type:

bool

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.

Parameters:
  • nGroupUID (int) – UID of the group to compare with.

  • bUseIntersection (bool) – If True performs an intersection, if False a difference operation.

Returns:

The list of UIDs that make up the difference (default) or intersection of the two groups.

Return type:

list(int)

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.

Parameters:
  • nGroupUID (int) – UID of the group to merge with.

  • bDeleteGroup (bool) – If True deletes the group with nGroupUID, otherwise the group is unnaffected.

Returns:

True if the merge has occurred succesfully.

Return type:

bool

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:

float

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:

float

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.

Parameters:
  • fRealScale (float) – The new per unit scaling factor for the load active power.

  • fReactiveScale (float) – The new per unit scaling factor for the load reactive power.

Returns:

True if successful.

Return type:

bool

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:

float

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:

float

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.

Parameters:
  • fRealScale (float) – The new per unit scaling factor for the generator active power.

  • fReactiveScale (float) – The new per unit scaling factor for the generator reactive power.

Returns:

True if successful.

Return type:

bool

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:

bool

SetFeederScalingActive(bUseFeederScaling) bool

Sets whether the group feeder active and reactive scaling is in use. NB. This will only work for feeder groups.

Parameters:

bUseFeederScaling (bool) – If True the feeder scaling will be made active.

Returns:

True if successful

Return type:

bool

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:

float

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:

float

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.

Parameters:
  • fRealScale (float) – The new per unit scaling factor for the active power.

  • fReactiveScale (float) – The new per unit scaling factor for the reactive power.

Returns:

True if successful.

Return type:

bool

GetDemandGroupDValue(nFieldIndex: int) float

Gets double value by field index for demand groups. NB. This will only work for demand groups.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The double value. Returns -99999999.0 if the field value is not successfully retrieved.

Return type:

double

GetDemandGroupSValue(nFieldIndex: int) str

Gets string value by field index for demand groups. NB. This will only work for demand groups.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The string value. Returns an empty string if the field value is not successfully retrieved.

Return type:

str

SetDemandGroupDValue(nFieldIndex: int, dValue: float) bool

Sets double value by field index for demand groups. NB. This will only work for demand groups.

Parameters:
  • nFieldIndex (int) – The field index.

  • dValue (float) – The given double value to set.

Returns:

True if successful.

Return type:

bool

SetDemandGroupSValue(nFieldIndex: int, strValue: str) bool

Sets string value by field index for demand groups. NB. This will only work for demand groups.

Parameters:
  • nFieldIndex (int) – The field index.

  • strValue (string) – The given string value to set.

Returns:

True if successful.

Return type:

bool

SetDemandGroupByDataMaps(mNumericData: dict[int, float], mStrData: dict[int, str]) bool

Update demand group data attributes with two dicts of numerical values and string values. NB. This will only work for demand groups.

Parameters:
  • mNumericData (dict(int, float)) – Dict of data to be set into demand group properties that are of type double. The dict key represents the field index to set data into, and the dict value represents the double value to be set.

  • mStrData (dict(int, float)) – The given string value to set. Dict of data to be set into demand group properties that are of type string. The dict key represents the field index to set data into, and the dict value represents the string value to be set.

Returns:

True if successful. False if any field in either dict has failed to be set.

Return type:

bool

GetFaultLevelGroupIValue(nFieldIndex: int) float

Gets integer value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The integer value. Returns -9999999 if the field value is not successfully retrieved.

Return type:

Integer

GetFaultLevelGroupDValue(nFieldIndex: int) float

Gets double value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The double value. Returns -99999999.0 if the field value is not successfully retrieved.

Return type:

double

GetFaultLevelGroupSValue(nFieldIndex: int) str

Gets string value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The string value. Returns an empty string if the field value is not successfully retrieved.

Return type:

str

SetFaultLevelGroupIValue(nFieldIndex: int, nValue: int) bool

Sets integer value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:
  • nFieldIndex (int) – The field index.

  • nValue (int) – The given integer value to set.

Returns:

True if successful.

Return type:

bool

SetFaultLevelGroupDValue(nFieldIndex: int, dValue: float) bool

Sets double value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:
  • nFieldIndex (int) – The field index.

  • dValue (float) – The given double value to set.

Returns:

True if successful.

Return type:

bool

SetFaultLevelGroupSValue(nFieldIndex: int, strValue: str) bool

Sets string value by field index for fault level groups. NB. This will only work for fault level groups.

Parameters:
  • nFieldIndex (int) – The field index.

  • strValue (string) – The given string value to set.

Returns:

True if successful.

Return type:

bool

SetFaultLevelGroupByDataMaps(mNumericData: dict[int, float], mStrData: dict[int, str]) bool

Update fault level group data attributes with two dicts of numerical values and string values. NB. This will only work for fault level groups.

Parameters:
  • mNumericData (dict(int, float)) – Dict of data to be set into fault level group properties that are numeric (double or int). The dict key represents the field index to set data into, and the dict value represents the numeric value to be set. NB. The numeric data is presented with float type. When setting into a field with the type int, the float value will be truncacted to the integer part.

  • mStrData (dict(int, float)) – The given string value to set. Dict of data to be set into fault level group properties that are of type string. The dict key represents the field index to set data into, and the dict value represents the string value to be set.

Returns:

True if successful. False if any field in either dict has failed to be set.

Return type:

bool

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.

Parameters:
  • strName (str) – The name of the field.

  • nDefault (int) – The integer default value.

  • dDefault (float) – The float default value.

  • strDefault (str) – The string default value.

  • bDefault (bool) – The bool default value.

Returns:

The new field index.

Return type:

int

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!

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

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!

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

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!

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

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!

Parameters:
  • strName (str) – The name of the field.

  • nFieldIndex (int) – The index of the field.

Returns:

True if the field is deleted successfully.

Return type:

bool

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.

Parameters:
  • strName (str) – The name of the field.

  • nFieldIndex (int) – The index of the field.

Returns:

The number of components with a non-default value in the extension field.

Return type:

int

GetIntExtensionValue(nFieldIndex: int) int

Get the integer value from the given extension field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The element value.

Return type:

int

GetDblExtensionValue(nFieldIndex: int) float

Get the float value from the given extension field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The element value.

Return type:

float

GetStrExtensionValue(nFieldIndex: int) str

Get the string value from the given extension field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The element value.

Return type:

str

GetBoolExtensionValue(nFieldIndex: int) bool

Get the boolean value from the given extension field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The element value.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

Returns:

The element value.

Return type:

int

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

Returns:

The element value.

Return type:

float

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

Returns:

The element value.

Return type:

str

GetListIntSize(nFieldIndex: int) int

Gets the size of the list of integers for the given enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

GetListDblSize(nFieldIndex: int) int

Gets the size of the list of doubles for the given enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

GetListStrSize(nFieldIndex: int) int

Gets the size of the list of strings for the given enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

SetIntExtensionValue(nFieldIndex: int, nValue: int) bool

Set the integer value for the given extension field.

Parameters:
  • nFieldIndex (int) – The field index.

  • nValue (int) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

SetDblExtensionValue(nFieldIndex: int, dValue: float) bool

Set the float value for the given extension field.

Parameters:
  • nFieldIndex (int) – The field index.

  • dValue (float) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

SetStrExtensionValue(nFieldIndex: int, sValue: str) bool

Set the string value for the given extension field.

Parameters:
  • nFieldIndex (int) – The field index.

  • sValue (str) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

SetBoolExtensionValue(nFieldIndex: int, bValue: bool) bool

Set the boolean value for the given extension field.

Parameters:
  • nFieldIndex (int) – The field index.

  • bValue (bool) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

  • nValue (int) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

  • dValue (float) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nIndex (int) – The index of the selected element.

  • strValue (str) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • nValue (int) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • dValue (float) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

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.

Parameters:
  • nFieldIndex (int) – The field index.

  • strValue (str) – The selected value.

Returns:

True if the operation was successful.

Return type:

bool

GetExtensionFieldIndex(strName: str) int

Returns the field index for the extended data field of a specified name.

Parameters:

strName (str) – The name of the extended data field.

Returns:

The field index.

Return type:

int

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.

Returns:

Dictionary of extension field indexes and field names.

Return type:

dict(int, str)