1 run_ribasim

run_ribasim(
    toml_path=None,
    *,
    ribasim_exe=None,
    cli_path=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_exe str | Path | None Path to the Ribasim CLI executable. If not provided, first checks the RIBASIM_EXE environment variable, then searches PATH. None
cli_path str | Path | None Deprecated alias for ribasim_exe. Use ribasim_exe instead. None
version bool Print version False
threads int | None Number of threads to use. If not specified, defaults to the JULIA_NUM_THREADS environment variable, and when unset, to using the physical CPU count. None

1.2 Raises

Name Type Description
FileNotFoundError If the Ribasim CLI is not found via RIBASIM_EXE or on PATH (when ribasim_exe 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", threads=4)
>>> run_ribasim("model.toml", ribasim_exe="/path/to/ribasim")
>>> run_ribasim(version=True)