IscNetComponent

The IscNetComponent class is the base class for all IPSA components. All functions that are exposed (described below) are accessible via the derived component classes. The functions in this section should therefore be used in conjunction with one of the IPSA component classes, e.g. for accessing busbar data the following code would be used:

busbar = ipsa_network.GetBusbar(“Busbar1”)
nBusbarUID = busbar.GetUID()

Extension Data

It is possible to add extension data to an object of any type. The definitions of the data extension fields are held as static data associated with the component, i.e. all components of the same type have the same extension data fields. The actual field values on each component are stored with the component.

All extension data is handled transparently by the IPSA filing modules and is not currently used for analysis by IPSA. All extension data fields are persistent when filed.

The field names for extended data fields should not contain spaces. Only alphanumeric characters and underscores are permitted.

Field Values

Below is a list of the field values for IscNetComponent which map each derived component object to a field value, sometimes used within the code.

IscNetComponent Field Values - Types

Field Name

PyIPSA class

Unknown

An unknown IscNetComponent object

Busbar

IscBusbar

Load

IscLoad

Generator

IscSynMachine

IndMachine

IscIndMachine

Harmonic

IscHarmonic

HarmonicFilter

IscFilter

MechSwCapacitor

IscMechSwCapacitor

StaticVArC

IscStaticVC

Battery

IscBattery

DCMachine

IscDCmachine

UniMachine

IscUMachine

GridInfeed

IscGridInfeed

Line

IscBranch

Transformer

IscTransformer

ThreeWTransformer

Isc3WTransformer

ACDCConverter

IscConverter

DCDCConverter

IscChopper

MGset

IscMGset

AVR

(Not mapped to PyIPSA)

Governor

(Not mapped to PyIPSA)

DCConverterCtl

(Not mapped to PyIPSA)

ACConverterCtl

(Not mapped to PyIPSA)

DCMachineCtl

(Not mapped to PyIPSA)

PluginModel

IscPlugin

CircuitBreaker

IscCircuitBreaker

SeriesRegulator

IscVoltageRegulator

ProtectionContainer

(Not mapped to PyIPSA)

Annotation

IscAnnotation

AnalysisLF

IscAnalysisLF

AnalysisFL

IscAnalysisFL

AnalysisMS

(Not mapped to PyIPSA)

AnalysisBD

(Not mapped to PyIPSA)

AnalysisTS

(Not mapped to PyIPSA)

AnalysisHM

IscAnalysisHM

AnalysisProt

(Not mapped to PyIPSA)

Automation

(Not mapped to PyIPSA)

Contingency

(Not mapped to PyIPSA)

Study

(Not mapped to PyIPSA)

Network

IscNetwork

ResultsDisplayStyle

(Not mapped to PyIPSA)

ResultsDisplayLF

(Not mapped to PyIPSA)

SQL

(Not mapped to PyIPSA)

IscNetComponent Class

class ipsa.IscNetComponent

The base class for all IPSA components.

GetUID() int

Returns the unique ID of the component.

Returns:

The unique ID of the component.

Return type:

int

GetName() str

Gets the name as a string - this is the name Python knows the object by (only identical to the IPSA name for busbars).

Returns:

The name of the component.

Return type:

str

SetName(strName: str) None

Sets the name to the component to the specified name.

Parameters:

strName (str) – The component name.

GetRealName(strName: str) str

Gets the user defined component name as a string for the specified component name.

Parameters:

strName (str) – The component Python name.

Returns:

Returns the IPSA component name.

Return type:

str

SetRealName(strName: str) None

Sets the user defined IPSA component name.

Parameters:

strName (str) – The IPSA component name.

GetFieldType(nFieldIndex: int) str

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

Parameters:

nFieldIndex (int) – The given enumerated field.

Returns:

Returns ‘String’, ‘Integer’, ‘Float’ or ‘Boolean’.

Return type:

str

GetFieldName(nFieldIndex: int) str

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

Parameters:

nFieldIndex (int) – The given enumerated field.

Returns:

The field name.

Return type:

str

GetFromBusbarUID(nBranchUID: int) int

Returns the FROM busbar UID of the given branch.

Parameters:

nBranchUID (int) – The branch UID.

Returns:

The FROM busbar UID.

Return type:

int

GetToBusbarUID(nBranchUID: int) int

Returns the TO busbar UID of the given branch.

Parameters:

nBranchUID (int) – The branch UID.

Returns:

The TO busbar UID.

Return type:

int

GetType() int

Returns an integer that matches one of the class field indices (e.g., IscNetComponent.Busbar).

Returns:

The integer that matches one of the class’ field indices.

Return type:

int

AddDataExtension(strName: str, default: int | float | str) int

Adds an integer data field and returns the new field index. Sets the default value.

Note: The variable of the function is not called default.

You can use either nDefault, dDefault, or strDefault specifying the default value.

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.

Returns:

The new field index.

Return type:

int

AddListIntDataExtension(strName: str) int

Adds a list of integers data field and returns the new field index. Sets the default value to an empty list.

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

AddListDblDataExtension(strName: str) int

Adds a list of doubles data field and returns the new field index. Sets the default value to an empty list.

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

AddListStrDataExtension(strName: str) int

Adds a list of strings data field and returns the new field index. Sets the default value to an empty list.

Parameters:

strName (str) – The name of the field.

Returns:

The new field index.

Return type:

int

GetListIntExtensionValue(nFieldIndex: int, nIndex: int) int

Get a single integer value from the list for the enumerated field.

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 for the enumerated field.

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 for the enumerated field.

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

Get size of the list of integers for the enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

GetListDblSize(nFieldIndex: int) int

Get size of the list of doubles for the enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

GetListStrSize(nFieldIndex: int) int

Get size of the list of strings for the enumerated field.

Parameters:

nFieldIndex (int) – The field index.

Returns:

The size of the field list.

Return type:

int

SetListIntExtensionValue(nFieldIndex: int, nIndex: int, nValue: int) bool

Sets the value of an element in a list of integers for the enumerated field at given position to given value.

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 an element in a list of doubles for the enumerated field at given position to given value.

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 an element in a list of strings for the enumerated field at given position to given value.

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 to the end of a list of integers for the enumerated field with the given value.

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 to the end of a list of doubles for the enumerated field with the given value.

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 to the end of a list of strings for the enumerated field with the given value.

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.

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)

GetNumberOfDataComponents() int

Deprecated. Returns the number of data components within the IscNetComponent object. For most IscNetComponents this will return 1. To obtain the number of sections in a branch the function IscBranch.GetSections() should instead be used

Returns:

Number of data components in the IscNetComponent object.

Return type:

int