Skip to main content

write_gridfm_batch

Function write_gridfm_batch 

Source
pub fn write_gridfm_batch(
    snapshots: &[GridfmSnapshot<'_>],
    out_dir: impl AsRef<Path>,
    opts: &GridfmOptions,
) -> Result<GridfmOutputs>
Expand description

Write a batch of scenarios as one gridfm-datakit dataset under out_dir/<network_name>/raw/, row-stacking every snapshot’s tables and keying them by the scenario column. The dataset name and the base element counts come from the first snapshot (shared across the batch by the shape check); the dropped/degenerate counts are summed over every snapshot, while reference_bus / n_branches_in_service record the first snapshot only (they can differ per scenario, so the manifest documents them as scenario 0’s).

§Errors

Propagates gridfm_record_batches_batch and any filesystem/Parquet error.