Skip to content

save_singlerun_results API Reference

geoloop.utils.helpers.save_singlerun_results

save_singlerun_results(
    config: SingleRunConfig, result: Any, outpath: Path
) -> None

Saves the results from a single model run into an HDF5 file. Results and input parameters are grouped into datasets based on their dimensions, ensuring compatibility with HDF5 storage formats.

The function organizes results by: - Time series (scalar variables) - Time and depth segment - Time, depth, and pipe - Depth segment only

Input parameters are grouped by: - Scalar parameters - Pipe-specific parameters - Depth-segment parameters (e.g., k_s) - Depth-specific parameters (e.g., k_g, Tg)

All datasets are saved into an HDF5 file with groups "results" and "parameters".

Parameters:

Name Type Description Default
config SingleRunConfig

Configuration object containing all input parameters from the JSON configuration file.

required
result SingleRunSim object

Results object from a single model run.

required
outpath Path

Filepath for saving the output HDF5 file. The file will be named {stem}_SR.h5 based on outpath.

required

Returns:

Type Description
None

Saves the results and input parameters to an HDF5 file on disk.