m3resp.export.export_session_summary#
- m3resp.export.export_session_summary(session, output_dir, *, summary_json=True, event_csvs=True, parameters_csv=True, postprocessing=True, structured_export=True, processing_run_id=None)[source]#
Write session summaries, result tables and array archives.
Structured export writes session metadata and processing history, plus tables for populated signal, parameter, interval, mask, quality and linked-breath collections. Per-interval metadata is written to
interval_data_metadata.json. Array values go toparameter_result_arrays.npz,interval_data_arrays.npzandpixel_masks.npzas needed, with references in their table rows. Exported times and units retain the values used by the session.- Parameters:
session (Any) – Session containing metadata, results, events and history.
output_dir (str | Path) – Directory to create and write into. Existing files with the same export names are overwritten.
summary_json (bool) – Write
summary.jsonwith metadata, quality, parameters, provenance and synchronization information.event_csvs (bool) – Write one CSV for each populated event list.
parameters_csv (bool) – Write
parameters.csvfor populated parameter groups.postprocessing (bool) – Include
emg_postprocessingin the summary and parameter-group table.structured_export (bool) – Write separate files for the scientific collections.
processing_run_id (str | None) – Run to link exported array files to when the session has a data-model recorder, typically
WorkflowResult.processing_run_id.Noneleaves archives without a run link.
- Returns:
The output directory used for the export.
- Return type:
Path
- Raises:
ValueError – If array values within an interval result have different shapes.
OSError – If the output directory or files cannot be written.
KeyError – If a supplied processing run is absent from the attached store.