Skip to main content

Module powerworld

Module powerworld 

Source
Expand description

Parse and emit PowerWorld auxiliary .aux files.

The implementation is layered. The AUX grammar decoder produces the generic AuxFile — every DATA and SCRIPT section, with field lists, value rows, and SUBDATA blocks intact — and knows the grammar from the official format guide: legacy and concise headers, comma delimited (CSV) sections, multiline field lists and value rows, // comments, quoting, and variablename:location field suffixes. On top of it, the BalancedNetwork mapping consumes the power flow core types (Bus, Load, Shunt, Gen, Branch) by field name, so column order and extra columns don’t matter. Object types outside the core stay reachable through aux_sections and survive the same format round trip byte for byte when the parsed module is passed to crate::emit.

The serializer emits DATA (Object, [fields]) { … } blocks for the core types, values in MW/MVAr/degrees, status as Closed/Open. Generator cost, HVDC, and storage are not represented and are reported on emission.

.pwb binary cases are parsed but cannot be emitted; see that module for the decoded vintages and parity evidence. .pwd files carry no case data, only the diagram, and read as a diagram space layer.

Structs§

AuxFile
A parsed auxiliary file: the ordered DATA and SCRIPT sections.
AuxObject
One DATA section: an object type, its declared field list, and the rows.
AuxRow
One value row of a DATA section, with any SUBDATA blocks that follow it.
AuxScript
A SCRIPT section, retained verbatim: powerio executes nothing.
AuxSubData
A <SUBDATA Type> ... </SUBDATA> block. The interior format is fixed per subobject type (some are free text, some are per line records), so the lines are kept verbatim.
Contingency
One contingency from a Contingency DATA section, with the actions of its CTGElement SUBDATA.
PwdDisplay
Decoded PowerWorld display file content.
PwdSubstation
One substation symbol from a display file: the identity row joined with its drawing record, in identity table (display) order. x and y are diagram coordinates as stored, y north positive (see the module docs).

Enums§

AuxSection
One section of an auxiliary file.

Functions§

aux_sections
Parse the auxiliary sections of a PowerWorld-sourced BalancedNetwork’s retained source. The typed model carries the power flow core; everything else in the original file (contingencies, limit sets, substations, …) is reachable here.
contingencies
The contingencies of a parsed aux file, in file order.
rating_set_names
Name → row lookup for the per object-type rating set names (RatingSetNameBus, RatingSetNameBranch, RatingSetNameInterface). Returns (set_number, name) pairs in file order.