run_ribasim
run_ribasim(toml_path=None, *, cli_path=None, version=False, threads=None)
Run the Ribasim CLI executable.
Parameters
| toml_path |
str | Path | None |
Path to the TOML file. Required unless version=True. |
None |
| cli_path |
str | Path | None |
Path to the Ribasim CLI executable. If not provided, searches PATH. |
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 |
Raises
|
FileNotFoundError |
If the Ribasim CLI is not found on PATH (when cli_path 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. |
Examples
>>> run_ribasim("model.toml")
>>> run_ribasim("model.toml", threads=4)
>>> run_ribasim("model.toml", cli_path="/path/to/ribasim")
>>> run_ribasim(version=True)