ogstools.core.result module#

class ogstools.core.result.Result[source]#

Bases: StorageBase

Container for OGS simulation results and output files.

Manages the simulation output directory containing result files (meshes, logs, etc.) and provides access to simulation outputs.

Initialize a Result object.

Parameters:

sim_output (Path | str | None) – Path to the simulation output directory. If None, uses a default location.

__init__(sim_output=None)[source]#

Initialize a Result object.

Parameters:

sim_output (Path | str | None) – Path to the simulation output directory. If None, uses a default location.

property sim_output: Path#

Get the path to the simulation output directory.

property log_file: Path#

Get the path to the log file, following the current target location.

save(target=None, overwrite=None, dry_run=False, archive=False, id=None)[source]#

Save or link the result output directory.

Creates a symlink to the actual simulation output directory at the target location. Use archive=True to copy all data instead.

Parameters:
  • target (Path | str | None) – Path where the result should be saved/linked. If None, uses a default location.

  • overwrite (bool | None) – If True, overwrite existing target. Defaults to False.

  • dry_run (bool) – If True, simulate save without creating files.

  • archive (bool) – If True, copy all data instead of creating symlinks.

  • id (str | None) – Optional identifier. Mutually exclusive with target.

Return type:

list[Path]

Returns:

List of Paths to created files/directories.