hydroflows.methods.wflow.wflow_run#

Wflow run method.

class hydroflows.methods.wflow.wflow_run.WflowRun(wflow_toml: Path, run_method: Literal['exe', 'docker', 'julia', 'apptainer', 'script'] = 'exe', wflow_bin: Path | None = None, **params)[source]#

Method for running a Wflow model.

Parameters:
  • wflow_toml (Path) – The file path to the Wflow (toml) configuration file.

  • run_method (Literal["exe", "docker", "julia", "apptainer", "script"]) – How to run Wflow. Options are ‘exe’ for running the executable directly (only on Windows), ‘docker’ or ‘apptainer’ for running the model in a container.

  • wflow_bin (Path) – The path to the Wflow executable

  • **params – Additional parameters to pass to the WflowRun Params instance. See wflow_run Params.

pydantic model hydroflows.methods.wflow.wflow_run.Input[source]#

Input parameters for the WflowRun method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field wflow_toml: Annotated[Path, AfterValidator(func=filedir_validator)] [Required]#

The file path to the Wflow (toml) configuration file from the Wflow model that needs to be run.

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.

pydantic model hydroflows.methods.wflow.wflow_run.Output[source]#

Output parameters for the WflowRun method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field wflow_output_timeseries: Path [Required]#

The path to the generated Wflow output timeseries. Note that the output file should be in the Wflow toml configuration, for example, in case that a model was updated using the hydroflows.methods.wflow.wflow_update_forcing.WflowUpdateForcing method and includes Sfincs source outflow locations (built using the hydroflows.methods.wflow.wflow_update_forcing.WflowBuild method), the file should be named as output_scalar.nc.

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.

pydantic model hydroflows.methods.wflow.wflow_run.Params[source]#

Parameters for the WflowRun.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field docker_tag: str = 'v0.8.1'#

The Docker tag to specify the version of the Docker image to use.

field julia_num_threads: int = 4#

The number of the threads to be used from Julia.

field run_method: Literal['exe', 'docker', 'julia', 'script', 'apptainer'] = 'exe'#

How to run wflow. Options are ‘exe’ for running the executable directly (only on Windows), ‘docker’ or ‘apptainer’ for running the model in a container.

field wflow_bin: Path | None = None#

The path to the wflow executable.

field wflow_run_script: Path | None = None#

Path to a script in which wflow is called.

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.