rompy.model.ModelRun#

pydantic model rompy.model.ModelRun[source]#

A model run.

It is intented to be model agnostic. It deals primarily with how the model is to be run, i.e. the period of the run and where the output is going. The actual configuration of the run is provided by the config object.

Further explanation is given in the rompy.core.Baseconfig docstring.

Fields:
field config: BaseConfig | SwanConfig | SwanConfigComponents | SchismCSIROConfig [Optional]#

The configuration object

field output_dir: Path = './simulations'#

The output directory

field period: TimeRange = TimeRange(start=datetime.datetime(2020, 2, 21, 4, 0), end=datetime.datetime(2020, 2, 24, 4, 0), duration=datetime.timedelta(days=3), interval=datetime.timedelta(seconds=900), include_end=True)#

The time period to run the model

field run_id: str = 'run_id'#

The run id

generate() str[source]#

Generate the model input files

Returns:

staging_dir

Return type:

str

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

zip() str[source]#

Zip the input files for the model run

This function zips the input files for the model run and returns the name of the zip file. It also cleans up the staging directory leaving only the settings.json file that can be used to repoducte the run.

Returns:

zip_fn

Return type:

str

property staging_dir#

The directory where the model is staged for execution

Returns:

staging_dir

Return type:

str