From bf2751359fd0dbefdc641849d09ea3e422aefe39 Mon Sep 17 00:00:00 2001 From: Jingru923 <47444880+Jingru923@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:27:55 +0100 Subject: [PATCH] Test models doc (#936) Fixes #915 --- docs/_quarto.yml | 1 + docs/python/test-models.qmd | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/python/test-models.qmd diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 05240b02e..a29c13c49 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -39,6 +39,7 @@ website: - python/index.qmd - python/examples.ipynb - python/reference/index.qmd + - python/test-models.qmd - title: "Coupled models" contents: - couple/index.qmd diff --git a/docs/python/test-models.qmd b/docs/python/test-models.qmd new file mode 100644 index 000000000..6a60503cf --- /dev/null +++ b/docs/python/test-models.qmd @@ -0,0 +1,24 @@ +--- +title: "Test models" +--- + +Ribasim developers use the following models in its testbench and in order to test new features. + +```{python} +# | code-fold: true +import ribasim_testmodels +import matplotlib.pyplot as plt + +for model_name, model_constructor in ribasim_testmodels.constructors.items(): + if model_name.startswith("invalid"): + continue + + model = model_constructor() + fig, ax = plt.subplots() + model.plot(ax) + ax.set_title(label=model_name, loc="left") + fig.text(0, 1, model_constructor.__doc__) + fig.tight_layout() + plt.show() + plt.close(fig) +```