Skip to content

Commit

Permalink
Test models doc (#936)
Browse files Browse the repository at this point in the history
Fixes #915
  • Loading branch information
Jingru923 authored Jan 11, 2024
1 parent 3da66d7 commit bf27513
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions docs/python/test-models.qmd
Original file line number Diff line number Diff line change
@@ -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)
```

0 comments on commit bf27513

Please sign in to comment.