Skip to content

Filter run_ribasim terminal output in docs#2980

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-documentation-formatting-issues
Draft

Filter run_ribasim terminal output in docs#2980
Copilot wants to merge 5 commits intomainfrom
copilot/fix-documentation-formatting-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

Documentation pages render raw terminal output from run_ribasim() calls — the Unicode logo with blank lines, repeated progress bar lines, and log messages — wasting significant vertical space. Node icons in Python plots are also too small.

  • Filter simulation output in docs: Modified docs/run_ribasim.py to capture stderr at the file descriptor level and filter out blank lines (invisible braille U+2800 characters) and progress bar repetitions from OrdinaryDiffEqCore. The logo art, startup info, and completion messages remain visible.
Original prompt

This section details on the original issue you should resolve

<issue_title>Example documentation has formatting issues</issue_title>
<issue_description>The documentation at https://ribasim.org/getting-started/examples.html has:

  • Terminal output with blank lines (stretching the logo)
  • Repeated progressbar outputs

Ideally we can prevent both, saving a lot of space.

Also, the node icons are too small in the Python plots.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add #| output: false to all run_ribasim() cells across documentation
  files to prevent terminal output (logo with blank lines, repeated
  progress bar lines) from appearing in rendered documentation
- Increase NODE_ICON_SIZE from 17.0 to 25.0 display-points to make
  node icons larger and more visible in Python plots

Co-authored-by: evetion <8655030+evetion@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix formatting issues in example documentation Suppress run_ribasim terminal output in docs and increase node icon size Mar 12, 2026
Copilot AI requested a review from evetion March 12, 2026 20:52
@evetion
Copy link
Copy Markdown
Member

evetion commented Mar 12, 2026

@copilot, we want to see the output of each run, just without all the newlines. Maybe we can tweak the terminal/shell output settings of run_ribasim?

Revert #| output: false from QMD files. Instead, capture stderr
from Julia at the fd level in docs/run_ribasim.py and filter out:
- Blank lines (invisible braille U+2800 and whitespace only)
- Progress bar repetitions from OrdinaryDiffEqCore

This preserves the logo, startup info and completion messages
while removing the blank lines stretching the logo and the
repeated progress bar output.

Co-authored-by: evetion <8655030+evetion@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot, we want to see the output of each run, just without all the newlines. Maybe we can tweak the terminal/shell output settings of run_ribasim?

Reverted the #| output: false directives. Instead, docs/run_ribasim.py now captures stderr at the fd level and filters it — removing blank/invisible braille lines (that stretched the logo) and progress bar repetitions from OrdinaryDiffEqCore, while preserving the logo art, startup info, and completion messages. See commit 046b94a.

Copilot AI changed the title Suppress run_ribasim terminal output in docs and increase node icon size Filter run_ribasim terminal output in docs and increase node icon size Mar 12, 2026
return ax

NODE_ICON_SIZE = 17.0 # display-points per icon
NODE_ICON_SIZE = 25.0 # display-points per icon
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set this size based on how it appear locally in a VSCode notebook. For that this seems to make it a bit too large:

NODE_ICON_SIZE = 17.0
Image

NODE_ICON_SIZE = 25.0
Image

Though in the docs at https://ribasim.org/reference/test-models.html#basic I agree they appear too small. I wonder how to best get this more in line?

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it in #3007 to 22, so a bit smaller than here.

visr added a commit that referenced this pull request Mar 31, 2026
@visr visr changed the title Filter run_ribasim terminal output in docs and increase node icon size Filter run_ribasim terminal output in docs Mar 31, 2026
visr added a commit that referenced this pull request Mar 31, 2026
Fixes #2998

- remove UserDemand from delwaq plot fraction default tracers
- standardize default tracer order in ribasim python and QGIS to
@DanielTollenaar's suggestion `Initial, Drainage, SurfaceRunoff,
FlowBoundary, LevelBounary, Precipitation` (first on the bottom)
- [Increase NODE_ICON_SIZE to
22](#2980 (comment))

I change the pixi docs task, `quarto-preview` is no more, now we have:

```bash
pixi run docs
```

To preview without executing code cells (much faster for checking
layout):

```bash
pixi run docs -- --no-execute
```

To preview a single file:

```bash
pixi run docs guide/delwaq.qmd
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example documentation has formatting issues

3 participants