1 run_ribasim

run_ribasim(toml_path=None, *, ribasim_home=None, version=False, threads=None)

Run the Ribasim CLI executable.

1.1 Parameters

Name Type Description Default
toml_path str | Path | None Path to the TOML file. Required unless version=True. None
ribasim_home str | Path | None Path to the Ribasim home directory. If not provided, first checks the RIBASIM_HOME environment variable, then searches PATH. None
version bool Print version False
threads int | None Number of threads to use. Defaults to 1. None

1.2 Raises

Name Type Description
FileNotFoundError If the Ribasim CLI is not found via RIBASIM_HOME or on PATH (when ribasim_home is not provided), or the toml_path does not exist.
ValueError If neither toml_path nor version is provided.
subprocess.CalledProcessError If the Ribasim CLI returns a non-zero exit code.

1.3 Examples

>>> run_ribasim("model.toml")
>>> run_ribasim("model.toml", ribasim_home="/path/to/ribasim")
>>> run_ribasim(version=True)