hydromt.model.Model.update#

Model.update(*, model_out: str | Path | None = None, write: bool | None = True, steps: List[Dict[str, Dict[str, Any]]] | None = None, forceful_overwrite: bool = False)[source]#

Single method to update a model based the settings in steps.

Methods will be run one by one based on the /order of appearance in steps (configuration file). For a list of available functions see The model API and The plugin documentation

Note that the * in the signature signifies that all of the arguments to this function MUST be provided as keyword arguments.

Parameters:
  • model_out (str, path, optional) – Destination folder to write the model schematization after updating the model. If None the updated model components are overwritten in the current model schematization if these exist. By default None.

  • write (bool, optional) – Write the updated model schematization to disk. By default True.

  • steps (Optional[List[Dict[str, Dict[str, Any]]]]) –

    Model build configuration. The configuration can be parsed from a

    configuration file using configread(). This is a list of nested dictionary where the first-level keys are the names of a component followed by the name of the method to run seperated by a dot. anny subsequent pairs will be passed to the method as arguments.

    [
        - <component_name>.<name of method1>: {
            <argument1>: <value1>, <argument2>: <value2>
        },
        - <component_name>.<name of method2>: {
            ...
        }
    ]
    
    forceful_overwrite:

    Force open files to close when attempting to write them. In the case you try to write to a file that’s already opened. The output will be written to a temporary file in case the original file cannot be written to.