hydromt_wflow.components.WflowConfigComponent#

class hydromt_wflow.components.WflowConfigComponent(model: Model, *, filename: str = 'wflow_sbm.toml', default_template_filename: str | None = None)[source]#

Manage the wflow TOML configuration file for model simulations/settings.

WflowConfigComponent data is stored in a dictionary. The component is used to prepare and update model simulations/settings of the wflow model.

Manage configuration files for model simulations/settings.

Parameters:
  • model (Model) – HydroMT model instance

  • filename (str) – A path relative to the root where the configuration file will be read and written if user does not provide a path themselves. By default ‘wflow_sbm.toml’

  • default_template_filename (str, optional) – A path to a template file that will be used as default in the create method to initialize the configuration file if the user does not provide their own template file. This can be used by model plugins to provide a default configuration template. By default None.

__init__(model: Model, *, filename: str = 'wflow_sbm.toml', default_template_filename: str | None = None)[source]#

Manage configuration files for model simulations/settings.

Parameters:
  • model (Model) – HydroMT model instance

  • filename (str) – A path relative to the root where the configuration file will be read and written if user does not provide a path themselves. By default ‘wflow_sbm.toml’

  • default_template_filename (str, optional) – A path to a template file that will be used as default in the create method to initialize the configuration file if the user does not provide their own template file. This can be used by model plugins to provide a default configuration template. By default None.

Methods

__init__(model, *[, filename, ...])

Manage configuration files for model simulations/settings.

create([template])

Create a new config file based on a template file.

get_value(key[, fallback, abs_path])

Get config options.

read([filename])

Read the wflow configuration file from <root/filename>.

remove(*args[, errors])

Remove a config key and return its value.

set(key, value)

Update the config dictionary at key(s) with values.

test_equal(other)

Test if two components are equal.

update(data)

Set the config dictionary at key(s) with values.

write([filename, config_root])

Write config to <(config_)root/config_fn>.

Attributes

data

Model config values.

data_catalog

Return the data catalog of the model this component is associated with.

model

Return the model object this component is associated with.

root

Return the root of the model this component is associated with.