Model#

Model class#

High-level methods#

Model([root, components, mode, data_libs, ...])

General and basic API for models in HydroMT.

Model.read([components])

Read provided components from disk.

Model.write([components])

Write provided components to disk with defaults.

Model.write_data_catalog([root, ...])

Write the data catalog to data_lib_path.

General methods#

Model.build(*[, write])

Single method to build a model from scratch based on settings in steps.

Model.update(*[, model_out, write, steps, ...])

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

Model.get_component(name)

Get a component from the model.

Model.add_component(name, component)

Add a component to the model.

Model.test_equal(other)

Test if two models are equal, based on their components.

Model.__enter__()

Enter the model runtime context.

Model.__exit__(exc_type, exc_value, traceback)

Exit the model runtime context.

Model attributes#

Model.data_catalog

DataCatalog for data access

Model.crs

Returns coordinate reference system embedded in region.

Model.root

Model root

Model.region

Return the model's region component.

Model.components

ModelRoot#

ModelRoot(path[, mode])

A class to handle model roots in a cross platform manner.

Attributes#

ModelRoot.mode

The mode of the model this object belongs to.

ModelRoot.is_writing_mode()

Test whether we are in writing mode or not.

ModelRoot.is_reading_mode()

Test whether we are in reading mode or not.

ModelRoot.is_override_mode()

Test whether we are in override mode or not.

General Methods#

ModelRoot.set(path[, mode])

Set the path and mode of the root.