docs: silence HiGHS console output in tutorial notebooks#678
Open
FBumann wants to merge 2 commits into
Open
Conversation
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>
Collaborator
Author
|
Substantial diff in https://linopy--678.org.readthedocs.build/en/678/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ipynbhas 9), this drowns the actual lesson in solver chatter. Passingoutput_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 isOutputFlagthere); 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=Falseto the piecewise tutorials as part of its broader cleanup. Whichever PR merges first will resolve the duplicate diff trivially.Test plan
🤖 Generated with Claude Code