Expand description
Read and write PowerWorld auxiliary .aux files.
The reader is layered. parse_aux parses any auxiliary file into 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 Network
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 via the retained source
(see crate::write_as).
The writer 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 write.
.pwb binary cases are read (never written) by parse_pwb; see that
module for the decoded vintages and the parity evidence. .pwd display
files carry no case data, only the diagram; parse_pwd_file and
parse_pwd read the decoded substation coordinates.
Structs§
- AuxFile
- A parsed auxiliary file: the ordered
DATAandSCRIPTsections. - AuxObject
- One
DATAsection: an object type, its declared field list, and the rows. - AuxRow
- One value row of a
DATAsection, with anySUBDATAblocks that follow it. - AuxScript
- A
SCRIPTsection, retained verbatim: powerio executes nothing. - AuxSub
Data - 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
ContingencyDATA section, with the actions of itsCTGElementSUBDATA. - 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.
xandyare 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
Network’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.
- parse_
aux - Parse auxiliary file
textinto anAuxFile. - parse_
powerworld - Parse a PowerWorld
.auxinto aNetwork, reading the Bus/Load/Shunt/ Gen/BranchDATAblocks by their declared field lists. - parse_
pwb - Parse
.pwbbytes into aNetwork.name_hint(the file stem) names the network; the binary carries no case name in the decoded region. - parse_
pwd - Parse the substation coordinates out of
.pwdbytes. - parse_
pwd_ display - Parse a
.pwddisplay file, returning metadata and decoded substations. - parse_
pwd_ file - Read and parse a
.pwddisplay file. - 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. - write_
aux - Serialize an
AuxFilein canonical form: legacy headers, space delimited values, one row per line, two space indentation. Idempotent underparse_aux. - write_
powerworld