Skip to main content

parse_target_format

Function parse_target_format 

Source
pub fn parse_target_format(name: &str) -> Option<TargetFormat>
Expand description

Map a format name (with the common aliases) to a TargetFormat, or None if unrecognized. Accepts matpower/m, powermodels-json/powermodels/pm, egret-json/egret, pandapower-json/pandapower/pp, psse/raw, powerworld/aux, pslf/epc, goc3-json/goc3, and surge-json/surge, opfdata-json/opfdata/gridopt, xiidm, jiidm, cgmes, and ucte/uct. Case-insensitive. The one place the bindings (Python, C ABI) share, so a new format means one new arm here, not three. CGMES emits a profile directory; PyPSA CSV folders, GridFM datasets, PowerWorld .pwb, and IEEE CDF cases are routed by crate::format::routing.

SourceFormat’s reported token is SourceFormat::name, which resolves here directly, so a module can emit to another module’s source format token for every supported case format. Compact spellings such as powermodelsjson are accepted as format name aliases.