Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: clarify meaning of merge_streams option (#664) #665

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/render/format_code_cells.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,18 @@ This can be set to:
(render/output/group-stderr-stdout)=
### Group into single streams

Cells may print multiple things to `stdout` and `stderr`.
Cells may print multiple things to `stdout` (and/or to `stderr`).
For example, if a cell prints status updates throughout its execution, each of these is often printed to `stdout`.
By default, these outputs may be split across multiple items, and will be rendered as separate "chunks" in your built documentation.

If you'd like each of the outputs in `stderr` and `stdout` to be merged into a single stream for each, use the following configuration:
If you'd like each of the outputs in `stdout` to be merged into a single stream for each, use the following configuration (see {ref}`config/intro`):

```python
nb_merge_streams = True
```

This will ensure that all `stderr` and `stdout` outputs are merged into a single group.
This will ensure that all `stdout` outputs are merged into a single group; likewise, all
`stderr` outputs will be merged into single (separate) group.
This also makes cell outputs more deterministic.
Normally, slight differences in timing may result in different orders of `stderr` and `stdout` in the cell output, while this setting will sort them properly.

Expand Down
2 changes: 1 addition & 1 deletion myst_nb/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __post_init__(self):
default=False,
metadata={
"validator": instance_of(bool),
"help": "Merge stdout/stderr execution output streams",
"help": "Merge all stdout execution output streams; same with stderr",
"sections": (
Section.global_lvl,
Section.file_lvl,
Expand Down
Loading