Parsers#
- parse_rawx(path)#
Parse a RAWX (JSON) file into a PsseCase.
Parsing does not validate the data; call
case.validate_schema()on the result if you need schema validation.
- parse_raw(path, *, allow_unmodeled_sections=False)#
Parse a RAW (text) file into a
PsseCase.- Parameters:
path -- Filesystem path to the RAW file.
allow_unmodeled_sections --
If
False(default), raiseValueErroron the first data row inside a section the parser knows about but does not yet model (GNE, induction machine, substation). IfTrue, those records are dropped one physical line at a time — use this only when you've confirmed the dropped section can't affect the PF result for your case.CAVEAT:
SUBSTATION DATAis multi-line per record (the substation header is followed by per-node and per-switch sub-records). The drop-one-line path will line up correctly when the next section marker appears, but anything that depends on knowing record boundaries within the section (e.g. node count) is unavailable today; only use the bypass when the section is empty or otherwise irrelevant to the power-flow result.
- Returns:
The parsed
PsseCase. Parsing does not validate the data; callPsseCase.validate_schema()if you need schema validation.- Raises:
ValueError -- If the file is malformed, has no header record, or contains a data row in an unmodeled section while
allow_unmodeled_sectionsisFalse.
- parse_matpower(path)#
Parse MATPOWER .m file to PsseCase.
- Parameters:
path -- Path to .m case file (e.g., case9.m, case14.m)
- Returns:
PsseCase with buses, loads, generators, branches, transformers
- Raises:
FileNotFoundError -- If file doesn't exist
ValueError -- If file format is invalid or file too large