hydromt_sfincs.components.config.SfincsConfig#

class hydromt_sfincs.components.config.SfincsConfig(model: SfincsModel)[source]#

“ Class to read and write SFINCS configuration files (sfincs.inp).

This class is the interface between the model and its ([SfincsConfigVariables](hydromt_sfincs.components.config.config.SfincsConfigVariables)) data attribute, which performs the actual reading, writing and validation of configuration variables. It manages file paths and the model’s grid/root state.

See also

SfincsConfigVariables

Pydantic model class for SFINCS configuration variables.

__init__(model: SfincsModel)[source]#

Methods

__init__(model)

close()

Clean up all open datasets.

finish_write()

Finish the write functionality after cleanup was called for all components in the model.

get(key[, fallback, abs_path])

Get the value for a specific key with validation check.

get_set_file_variable(key[, value, default])

Return the absolute file path for a given 'key'.

read()

Read a text file with the sfincs configuration from the root folder and populate the SfincsConfigVariables.

set(key, value[, skip_validation])

Set a value for a specific key with validation using Pydantic's model_validate.

test_equal(other)

Test if two components are equal.

update([dict, skip_validation])

Update attributes using a dictionary or keyword arguments.

update_grid_from_config()

Update the grid properties from the configuration.

write([filename, write_description, ...])

Write the SfincsConfigVariables to a text file in the root folder of the model.

Attributes

data

Return the Pydantic SfincsConfigVariables object.

data_catalog

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

filename

Return the absolute filename of the SFINCS input file.

model

Return the model object this component is associated with.

name_in_model

Find the name of the component in the parent model components.

root

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