Format registry#
- load_case(path, *supplements)#
Parse a case, and any supplemental data files, selected by file-name suffix.
The case suffixes are
.raw,.rawx,.json, and.m. Each parser resolves the case revision before this function returns. The supplemental suffixes are.seqand.iec, and each one binds its records to the equipment the case holds. Supplements bind in the order given, which is what a sequence file's change code reads.- Parameters:
path -- Path to the case file.
supplements -- Paths to supplemental data files.
- Returns:
The parsed case, carrying every supplement.
- Raises:
ValueError -- If a file suffix is not supported.
OSError -- If a file cannot be read.
Examples
>>> case = load_case("grid.raw", "grid.seq")
- attach(case, path, *, format=None)#
Read a supplemental data file and return a case that carries it.
Use this when the supplement arrives after the case. load_case() reads both at once. The given case is unchanged: the returned case shares its network records and holds its own supplemental data.
- Parameters:
case -- Case whose equipment the file binds to.
path -- Path to a
.seqor.iecfile.format -- Format name,
"seq"or"iec". Name it when the caller already knows the kind and the file name does not say it. The file-name suffix selects the format when this is None.
- Returns:
A new case carrying the supplemental data.
- Raises:
ValueError -- If the format name, or the file suffix, is not supported.
OSError -- If the file cannot be read.
- load_power_flow_source(path)#
Load one power-flow source by its file-name suffix.
- Parameters:
path -- Path to a supported case file, phase model, or mixed-system manifest.
- Returns:
A source accepted by compile_power_flow_system().
- Raises:
ValueError -- If the file suffix is not supported.
OSError -- If the file cannot be read.