Skip to main content

write_gridfm_dataset

Function write_gridfm_dataset 

Source
pub fn write_gridfm_dataset(
    net: &BalancedNetwork,
    scenario: i64,
    out_dir: impl AsRef<Path>,
    opts: &GridfmOptions,
) -> Result<GridfmOutputs>
Expand description

Write the gridfm-datakit Parquet dataset for one case under out_dir/<sanitized network name>/raw/ (see sanitize_stem), matching datakit’s directory layout. Stamps scenario into the id columns. Writes bus_data.parquet, gen_data.parquet, branch_data.parquet, optionally y_bus_data.parquet, and a gridfm_meta.json manifest.

Expects a raw snapshot (powers in MW, angles in degrees); pass the parsed BalancedNetwork, not a to_normalized per-unit product, whose fields would be mislabeled.

§Errors

Propagates gridfm_record_batches and any filesystem/Parquet error.