Collection Module
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(AObject)
Assigns one collection instance to another, must be overridden by descendants.
- Raises
NotImplementedError – Must be implemented in descendant.
- class TEracsDataCollectionEventEnum(value)
‘CLEARED’ event is raised whenever data is cleared from a collection. ‘MODIFIED’ event is raised whenever some underlying data is modified in any of the lists.
- Inherit
- CLEARED = 1
- MODIFIED = 2
- class TEracsDataCollection
Holds all element data for a particular network.
- Inherit
- property HeaderRecord
Header information such as network and data state name.
- Type
dict.
- Writable
False.
- property LoadflowRecord
Loadflow parameters.
- Type
dict.
- Writable
False.
- property AppearanceSettings
Defines how the network should be drawn, used when exporting single-line diagram to SVG format.
- Type
dict.
- Writable
False.
- property ResultSettings
Defines how results should be drawn, such as including units.
- Type
dict.
- Writable
False.
- property VoltageLevelTable
Defines the voltage level table used in ERACS for the specific network.
- Type
list.
- Writable
False.
- property TextRecords
A list of all text elements in the network.
- Type
list.
- Writable
False.
- property Busbars
A list of all busbar elements in the network.
- Type
list.
- Writable
False.
- property ArcFlashEnclosures
A list of all arc flash enclosure elements in the network.
- Type
list.
- Writable
False.
- property TransmissionLines
A list of all transmission line elements in the network.
- Type
list.
- Writable
False.
- property Cables
A list of all cable elements in the network.
- Type
list.
- Writable
False.
- property SeriesElements
A list of all series elements in the network.
- Type
list.
- Writable
False.
- property TapChangers
A list of all tap changer elements in the network.
- Type
list.
- Writable
False.
- property Windings
A list of all transformer winding elements in the network.
- Type
list.
- Writable
False.
- property NeutralEarths
A list of all neutral earth elements in the network.
- Type
list.
- Writable
False.
- property EmbeddedCables
A list of all embedded cable elements in the network.
- Type
list.
- Writable
False.
- property Transformers
A list of all transformer elements in the network.
- Type
list.
- Writable
False.
- property InductionMachines
A list of all induction machine elements in the network.
- Type
list.
- Writable
False.
- property GridInfeeds
A list of all grid infeed elements in the network.
- Type
list.
- Writable
False.
- property SynchronousMachines
A list of all synchronous machine elements in the network.
- Type
list.
- Writable
False.
- property EmbeddedTransformers
A list of all embedded transformer elements in the network.
- Type
list.
- Writable
False.
- property Shunts
A list of all shunt elements in the network.
- Type
list.
- Writable
False.
- property BusSections
A list of all bus section elements in the network.
- Type
list.
- Writable
False.
- property Switches
A list of all switch elements in the network.
- Type
list.
- Writable
False.
- property SwitchGroups
A list of all switch groups in the network.
- Type
list.
- Writable
False.
- property SwitchGroupsWithSwitchData
- property ProtectionDevices
A list of all protection devices in the network.
- Type
list.
- Writable
False.
- property Canvas
Canvas information, used by the SVG export.
- Type
dict.
- Writable
False.
- property CurrentInjections
Harmonic data for current injection, used in Harmonic Injection studies.
- Type
list.
- Writable
False.
- EventEnum()
Returns the event enum used by the implementing events class. This can be called from anywhere to find out what events are exposed.
- 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} ... ) {'id': 'foo', 'freq': 10, 'kv': 0.43, 'typecode': 'busbar', 'tphmva': 72, 'sphmva': 72, 'seqnum': 1}
>>> 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}]