Skip to content

docs: silence HiGHS console output in tutorial notebooks#678

Open
FBumann wants to merge 2 commits into
masterfrom
docs/silence-solver-logs
Open

docs: silence HiGHS console output in tutorial notebooks#678
FBumann wants to merge 2 commits into
masterfrom
docs/silence-solver-logs

Conversation

@FBumann
Copy link
Copy Markdown
Collaborator

@FBumann FBumann commented May 11, 2026

Summary

HiGHS prints a banner + progress lines to the Python REPL on every m.solve() call by default. In a tutorial that calls solve many times (e.g. manipulating-models.ipynb has 9), this drowns the actual lesson in solver chatter. Passing output_flag=False (a HiGHS solver option forwarded via **solver_options) suppresses it.

Touches every tutorial that runs HiGHS — 21 m.solve(...) calls across 6 notebooks:

  • create-a-model.ipynb (1)
  • create-a-model-with-coordinates.ipynb (1)
  • manipulating-models.ipynb (9)
  • transport-tutorial.ipynb (1)
  • piecewise-linear-constraints.ipynb (8)
  • piecewise-inequality-bounds.ipynb (1)

Left alone:

  • infeasible-model.ipynb — uses Gurobi (kwarg is OutputFlag there); also showing solver feedback may be pedagogically relevant for infeasibility detection.
  • solve-on-remote.ipynb / solve-on-oetc.ipynb — remote handler manages its own logging.

Note on overlap with #677

#677 (piecewise precision pass) also adds output_flag=False to the piecewise tutorials as part of its broader cleanup. Whichever PR merges first will resolve the duplicate diff trivially.

Test plan

  • CI's "Test documentation notebooks" job passes on all six touched notebooks.
  • Rendered docs no longer show a HiGHS banner block above each solve output.

🤖 Generated with Claude Code

FBumann and others added 2 commits May 11, 2026 15:09
HiGHS prints a banner + progress lines to the Python REPL on every
m.solve() call by default.  In a tutorial that calls solve many times,
this drowns the actual lesson in solver chatter.  Pass output_flag=False
(a HiGHS solver option forwarded via **solver_options) to suppress it.

Touches the four notebooks where solver_name="highs" is the only solver
invoked:

- create-a-model.ipynb
- create-a-model-with-coordinates.ipynb
- manipulating-models.ipynb (9 solves)
- transport-tutorial.ipynb

Left alone:
- infeasible-model.ipynb (uses Gurobi, kwarg is OutputFlag there;
  also showing solver feedback may be pedagogically relevant for
  infeasibility detection).
- solve-on-remote.ipynb / solve-on-oetc.ipynb (remote handler manages
  its own logging).
- piecewise-*.ipynb (already addressed in #677).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extends the log-silencing scope to the two piecewise tutorials, which
together call m.solve() nine times.  Same transformation as the other
notebooks — output_flag=False as a HiGHS-specific kwarg forwarded via
**solver_options.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FBumann FBumann requested a review from FabianHofmann May 11, 2026 13:33
@FBumann
Copy link
Copy Markdown
Collaborator Author

FBumann commented May 11, 2026

Substantial diff in https://linopy--678.org.readthedocs.build/en/678/
I think this really boosts readability.

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.

1 participant