Collection Module

Inheritance diagram of Collection

All collection-related classes reside in this module. There are two main classes, collection classes for data and collection classes for results.

class TEracsCollection

Holds a collection of assignable data. This class is not to be instantiated directly, use one of the descendants.

ClearData()

Clears all Data, must be overridden by descendants.

Raises

NotImplementedError – Must be implemented in descendant.

Assign()

Assigns one collection instance to another, must be overridden by descendants.

Raises

NotImplementedError – Must be implemented in descendant.

class TEracsDataCollection

Holds all element data for a particular network.

Inherits

TEracsCollection.

HeaderRecord

Header information such as network and data state name.

Type

Dictionary.

Writable

False.

LoadflowRecord

Loadflow parameters.

Type

Dictionary.

Writable

False.

AppearanceSettings

Defines how the network should be drawn, used when exporting single-line diagram to SVG format.

Type

Dictionary.

Writable

False.

ResultSettings

Defines how results should be drawn, such as including units.

Type

Dictionary.

Writable

False.

VoltageLevelTable

Defines the voltage level table used in ERACS for the specific network.

Type

List.

Writable

False.

TextRecords

A list of all text elements in the network.

Type

List.

Writable

False.

Busbars

A list of all busbar elements in the network.

Type

List.

Writable

False.

TransmissionLines

A list of all transmission line elements in the network.

Type

List.

Writable

False.

Cables

A list of all cable elements in the network.

Type

List.

Writable

False.

SeriesElements

A list of all series elements in the network.

Type

List.

Writable

False.

TapChangers

A list of all tap changer elements in the network.

Type

List.

Writable

False.

Windings

A list of all transformer winding elements in the network.

Type

List.

Writable

False.

NeutralEarths

A list of all neutral earth elements in the network.

Type

List.

Writable

False.

EmbeddedCables

A list of all embedded cable elements in the network.

Type

List.

Writable

False.

Transformers

A list of all transformer elements in the network.

Type

List.

Writable

False.

InductionMachines

A list of all induction machine elements in the network.

Type

List.

Writable

False.

GridInfeeds

A list of all grid infeed elements in the network.

Type

List.

Writable

False.

SynchronousMachines

A list of all synchronous machine elements in the network.

Type

List.

Writable

False.

EmbeddedTransformers

A list of all embedded transformer elements in the network.

Type

List.

Writable

False.

Shunts

A list of all shunt elements in the network.

Type

List.

Writable

False.

BusSections

A list of all bus section elements in the network.

Type

List.

Writable

False.

Switches

A list of all switch elements in the network.

Type

List.

Writable

False.

ProtectionDevices

A list of all protection devices in the network.

Type

List.

Writable

False.

Canvas

Canvas information, used by the SVG export.

Type

Dictionary.

Writable

False.

ClearData()

Clears all element data including header records, Loadflow records, appearance settings, busbar data, etc…

Doctest
>>> col = TEracsDataCollection()
>>> col.HeaderRecord['foo'] = 'bar'
>>> col.HeaderRecord
{'foo': 'bar'}
>>> col.ClearData()
>>> col.HeaderRecord
{}
Assign(AObject)

Assigns a set of data from one object to another. Clears internal lists, then reassigns them using the lists from the object provided. This object could be another Data class instance, or an instance of one of the file loader classes.

Parameters

AObject (TEracsCollection) – The object to copy data from.

Raises

TEracsArgumentError – If object doesn’t contain an expected property.

Doctest
>>> col1 = TEracsDataCollection()
>>> col1.Busbars.append(
...     {'id': 'foo', 'freq': 10, 'kv': 0.43}
... )
>>> col2 = TEracsDataCollection()
>>> try:
...     col2.Assign(col1)
... except TEracsDataError:
...     # Raised due to other data items being empty
...     pass
>>> col2.Busbars
[{'id': 'foo', 'freq': 10, 'kv': 0.43, 'typecode': 'busbar', 'tphmva': 72, 'sphmva': 72, 'seqnum': 1}]