Skip to main content

pio_parse_str

Function pio_parse_str 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pio_parse_str( text: *const c_char, format: *const c_char, errbuf: *mut c_char, errlen: usize, ) -> *mut PioNetwork
Expand description

Parse in-memory case text of the named format into a network handle. Unlike pio_parse_file there is no path to infer from, so format is required: one of matpower/m, powermodels/pm, egret, pandapower-json/pandapower/pp, psse/raw, powerworld/aux (see TargetFormat::from_str). PyPSA CSV folders are directories, not text; parse them with pio_parse_file and from = "pypsa-csv". Read fidelity warnings attach to the handle (pio_parse_warnings). Returns NULL on error and writes the message into errbuf. Free the handle with pio_network_free.