hydroflows.methods.wflow.wflow_build#

Build a Wflow model from scratch using hydromt_wflow.

class hydroflows.methods.wflow.wflow_build.WflowBuild(region: ~pathlib.Path, config: ~pathlib.Path, catalog_path: ~pathlib.Path | None = None, predefined_catalogs: ~typing.Annotated[list[str], ~pydantic.functional_validators.BeforeValidator(func=~hydroflows._typing.<lambda>, json_schema_input_type=PydanticUndefined)] | None = None, gauges: ~pathlib.Path = None, wflow_root: ~pathlib.Path = 'models/wflow', **params)[source]#

Build a Wflow model from scratch using hydromt_wflow.

Parameters:
  • region (Path) – The file path to the geometry file that defines the region of interest for constructing a wflow model.

  • config (Path) – The path to the configuration file (.yml) that defines the settings to build a Wflow model. In this file the different model components that are required by the hydromt_wflow.wflow.WflowModel are listed.

  • catalog_path (Optional[Path], optional) – The path to the data catalog file (.yml) that contains the data sources specified in the config file. If None (default), a predefined data catalog should be provided.

  • predefined_catalogs (Optional[ListOfStr], optional) – A list containing the predefined data catalog names.

  • wflow_root (Path) – The path to the root directory where the wflow model will be created, by default “models/wflow”.

  • **params – Additional parameters to pass to the WflowBuild instance. See wflow_build Params.

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

Input parameters for the WflowBuild 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 catalog_path: Annotated[Path, AfterValidator(func=filedir_validator)] | None = None#

The file path to the data catalog. This is a file in yml format, which should contain the data sources specified in the config file.

field config: Path = PosixPath('/home/runner/work/HydroFlows/HydroFlows/hydroflows/cfg/wflow_build.yml')#

The path to the configuration file (.yml) that defines the settings to build a Wflow model. In this file the different model components that are required by the hydromt_wflow.WflowModel are listed. Every component defines the setting for each hydromt_wflow setup methods. For more information see hydromt_wflow method documentation

field gauges: Path | None = None#

Gauges vector file including the locations of interest to get Wflow simulation outputs. The vector file must include a column named ‘index’ that contains the gauge numbers. An example of this vector file is the Sfincs source points GeoJSON, which is necessary for coupling Wflow with Sfincs to run, for example, a fluvial flood risk assessment workflow.

field region: Path [Required]#

The file path to the geometry file that defines the region of interest for constructing a Wflow model for the upstream area draining into the specified region. An example of such a file could be the Sfincs region GeoJSON.

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_build.Output[source]#

Output parameters for the WflowBuild 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.

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_build.Params[source]#

Parameters for the WflowBuild method.

See also

hydromt_wflow.WflowModel

For more details on the WflowModel used in hydromt_wflow.

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 plot_fig: bool = True#

Determines whether to plot a figure with the derived Wflow base maps.

field predefined_catalogs: <lambda>, json_schema_input_type=PydanticUndefined)] | None = None#

List of predefined data catalogs containing the data sources specified in the config file.

field wflow_root: Path [Required]#

The path to the root directory where the wflow model will be created.

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.