Tip

For an interactive online version click here: Binder badge

Example: Working with models from CLI#

HydroMT has the following high-level functionality from the Command Line Interface (CLI) for setting up models from raw data or adjusting models:

  • building a model: building a model from scratch.

  • updating a model: adding or changing model components of an existing model.

Here we show how to build and update a hypothetical distributed model from the command line interface (CLI) based on the generic HydroMT Model.

Lets first check which models are available in our environment:

[1]:
!hydromt --help
Usage: hydromt [OPTIONS] COMMAND [ARGS]...

  Command line interface for hydromt models.

Options:
  --version     Show the version and exit.
  --models      Print available model plugins and exit.
  --components  Print available component plugins and exit.
  --plugins     Print available component plugins and exit.
  --help        Show this message and exit.

Commands:
  build   Build models
  check   Validate config / data catalog / region
  export  Export data
  update  Update models
[2]:
!hydromt --models
Model plugins:
        - model (hydromt 1.0.1.dev0)
[3]:
!hydromt --components
Component plugins:
        - ConfigComponent (hydromt 1.0.1.dev0)
        - DatasetsComponent (hydromt 1.0.1.dev0)
        - GeomsComponent (hydromt 1.0.1.dev0)
        - GridComponent (hydromt 1.0.1.dev0)
        - MeshComponent (hydromt 1.0.1.dev0)
        - SpatialDatasetsComponent (hydromt 1.0.1.dev0)
        - TablesComponent (hydromt 1.0.1.dev0)
        - VectorComponent (hydromt 1.0.1.dev0)

Build a model from CLI#

TBC