ogstools.ogs6py.referenced_file module#

class ogstools.ogs6py.referenced_file.ReferencedFile[source]#

Bases: BuildTree, StorageBase

Represents a single file referenced by path in an OGS project file.

Initialize a StorageBase object.

Parameters:
  • class_id – Type identifier for this saveable object (e.g., “Model”, “Simulation”).

  • file_ext – File extension if this is a file (e.g., “yaml”, “prj”). Empty string for directories.

  • default_target – Default path for saving if none is specified.

  • id – Unique identifier. If None, generates a timestamp-based ID.

__init__(tree, xpath=None)[source]#

Initialize a StorageBase object.

Parameters:
  • class_id – Type identifier for this saveable object (e.g., “Model”, “Simulation”).

  • file_ext – File extension if this is a file (e.g., “yaml”, “prj”). Empty string for directories.

  • default_target – Default path for saving if none is specified.

  • id – Unique identifier. If None, generates a timestamp-based ID.

property filename: str | None#

Filename as stored in the project file, or None if not set.

property is_file: bool#

Check if this saveable represents a file (vs. directory).

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

list[Path]