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 provides methods for reading and writing SFINCS configuration files, updating configuration variables, and managing file paths for model input files. It uses a Pydantic model ([SfincsConfigVariables](hydromt_sfincs.components.config.config.SfincsConfigVariables)) for validation and serialization of configuration variables.
See also
SfincsConfigVariablesPydantic 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 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
Return the Pydantic SfincsConfigVariables object.
data_catalogReturn the data catalog of the model this component is associated with.
filenameReturn the filename of the SFINCS input file.
modelReturn the model object this component is associated with.
name_in_modelFind the name of the component in the parent model components.
rootReturn the root of the model this component is associated with.