### Install ribasim-api with pip Source: https://github.com/deltares/ribasim/blob/main/python/ribasim_api/README.md Install the ribasim-api package using pip. ```bash pip install ribasim-api ``` -------------------------------- ### Install ribasim-api with conda Source: https://github.com/deltares/ribasim/blob/main/python/ribasim_api/README.md Install the ribasim-api package using conda from the conda-forge channel. ```bash conda install -c conda-forge ribasim-api ``` -------------------------------- ### Get Ribasim CLI Help Source: https://github.com/deltares/ribasim/blob/main/build/README.md Call this command to display the usage information for the Ribasim command-line interface. ```sh ribasim --help ``` -------------------------------- ### Initialize and Update Libribasim from Python Source: https://github.com/deltares/ribasim/blob/main/build/README.md This Python snippet demonstrates how to load the libribasim shared library using ctypes, initialize it with a configuration file, and run a simulation update step. Note the use of `winmode=0x08` for Windows compatibility. ```python from ctypes import CDLL, c_int, c_char_p, create_string_buffer, byref c_dll = CDLL("libribasim", winmode=0x08) # winmode for Windows config_path = "ribasim.toml" c_dll.initialize(c_char_p(config_path.encode())) c_dll.update() ``` -------------------------------- ### Generate and Parse Delwaq Model with Python Source: https://github.com/deltares/ribasim/blob/main/python/ribasim/ribasim/delwaq/README.md Use Python scripts to generate a Delwaq model from a Ribasim configuration, run Delwaq, and parse the results back into the Ribasim model. Ensure the D3D_HOME environment variable is set for run_delwaq to function correctly. ```python from pathlib import Path from generate import generate from parse import parse from util import run_delwaq toml_path = Path("generated_testmodels/basic/ribasim.toml") generate(toml_path) run_delwaq() model = parse(toml_path) ``` -------------------------------- ### Build Ribasim Application Source: https://github.com/deltares/ribasim/blob/main/build/README.md Execute this command to build the Ribasim application and its shared library. Ensure long paths are enabled on Windows if build failures occur. ```sh pixi run build ``` -------------------------------- ### Run Delwaq Model using Docker Source: https://github.com/deltares/ribasim/blob/main/python/ribasim/ribasim/delwaq/README.md Execute the Delwaq model within a Docker container, mounting the local 'model' directory to '/mnt/myModel' inside the container. This command assumes you are in the directory containing the 'model' folder. ```bash docker run --mount type=bind,source="$(pwd)/model",target=/mnt/myModel \ --workdir /mnt/myModel containers.deltares.nl/delft3d/delft3dfm run_dimr.sh ``` -------------------------------- ### Run Ribasim CLI Source: https://github.com/deltares/ribasim/blob/main/python/ribasim/ribasim/delwaq/README.md Execute a Ribasim model configuration using the Ribasim Command Line Interface. ```bash ribasim generated_testmodels/basic/ribasim.toml ``` -------------------------------- ### Log into Deltares Docker Containers Source: https://github.com/deltares/ribasim/blob/main/python/ribasim/ribasim/delwaq/README.md Authenticate with the Deltares container registry to pull and run containerized Delwaq models. Use your Deltares email and a generated token for login. ```bash docker login containers.deltares.nl # use your deltares email + token ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.