Skip to main content

Module read

Module read 

Source
Expand description

.dss raw objects into the canonical MulticonductorNetwork.

Every OpenDSS default materializes into an explicit model value, recorded in MulticonductorNetwork::defaulted under the "class.name" key. Specified properties the typed fields do not capture go into the element’s extras verbatim (string values), so a later writer can reproduce them. Bus specs resolve with the engine’s fill rule: phase conductors default to nodes 1..=phases, every remaining conductor to ground (node 0), and the written dot list overrides from the left. Ground connections become an explicit perfectly grounded neutral terminal on the bus, named max(4, highest node + 1) to match PowerModelsDistribution and the public BMOPF examples.

Functions§

network_from_raw
Lowers an executed raw script into the typed model.
parse_dss_file
Parses a .dss file, following includes, into the canonical model. Redirect/Compile/Buscoords includes are confined to the directory of path: an include that resolves outside that directory is refused with a warning — whether it climbs out with .., is an absolute path outside the directory, or escapes through a symbolic link. Inside that directory nothing is restricted: a case file reads any file placed beneath it, and the leading token of each line the parser does not recognize comes back in the warnings, so an untrusted case belongs in a directory of its own. (Executor::resolve documents the exact lexical rule that decides whether an absolute include counts as inside the directory.) The includes a single parse follows are budgeted in files and in bytes; a case that exhausts the budget stops following includes and records an Error finding.
parse_dss_str
Parses .dss text. Filesystem includes are disabled: string input has no base directory, so Redirect/Compile/Buscoords read nothing and each is recorded as a warning. This keeps untrusted text (an uploaded case, say) from reading arbitrary local files. Use parse_dss_file to follow includes, which then stay confined to the case directory.