Skip to content

correctly suppress highs output in linopy#622

Merged
kim-mskw merged 1 commit intomainfrom
fix_suppress_highs
Aug 11, 2025
Merged

correctly suppress highs output in linopy#622
kim-mskw merged 1 commit intomainfrom
fix_suppress_highs

Conversation

@maurerle
Copy link
Copy Markdown
Member

@maurerle maurerle commented Aug 5, 2025

Pull Request

The suppress_output method redirects the output buffers.
This is generally not a good idea, instead, the underlying source of unwanted output should be tackled.

This PR fixes the output from highs in the redispatch market.

Related Issue

This fixes #619 as this produced errors in Colab.

Description

There is still a line Running HiGHS 1.11.0 (git hash: 364c83a): Copyright (c) 2025 HiGHS under MIT licence terms which is printed for every solving.
This is going to be fixed in linopy with PyPSA/linopy#479

Changes Proposed

  • correctly pass the silence args to the highs solver
  • delete now unused suppress_output function
  • improve package installation in colab by calling pip less often

Testing

[Describe the testing you've done, including any specific test cases or scenarios]

Checklist

Please check all applicable items:

  • Code changes are sufficiently documented (docstrings, inline comments, doc folder updates)
  • New unit tests added for new features or bug fixes
  • Existing tests pass with the changes
  • Reinforcement learning examples are operational (for DRL-related changes)
  • Code tested with both local and Docker databases
  • Code follows project style guidelines and best practices
  • Changes are backwards compatible, or deprecation notices added
  • New dependencies added to pyproject.toml
  • A note for the release notes doc/release_notes.rst of the upcoming release is included
  • Consent to release this PR's code under the GNU Affero General Public License v3.0

Additional Notes (if applicable)

[Any additional information, concerns, or areas you want reviewers to focus on]

Screenshots (if applicable)

[Add screenshots to demonstrate visual changes]

@maurerle maurerle requested a review from kim-mskw August 5, 2025 16:18
@maurerle maurerle force-pushed the fix_suppress_highs branch from d984ab7 to d85ce10 Compare August 5, 2025 16:18
@maurerle maurerle force-pushed the fix_suppress_highs branch from d85ce10 to a38328c Compare August 5, 2025 22:32
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.32%. Comparing base (46920d6) to head (a38328c).
⚠️ Report is 52 commits behind head on main.

Files with missing lines Patch % Lines
assume/markets/clearing_algorithms/redispatch.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #622      +/-   ##
==========================================
+ Coverage   80.16%   80.32%   +0.15%     
==========================================
  Files          53       53              
  Lines        7714     7694      -20     
==========================================
- Hits         6184     6180       -4     
+ Misses       1530     1514      -16     
Flag Coverage Δ
pytest 80.32% <0.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maurerle
Copy link
Copy Markdown
Member Author

maurerle commented Aug 5, 2025

Tested using https://colab.research.google.com/github/assume-framework/assume/blob/fix_suppress_highs/examples/notebooks/10_DSU_and_flexibility.ipynb and pip install https://github.com/assume-framework/assume/archive/refs/heads/fix_suppress_highs.zip pypsa in the first installation line.
Looks good.

@maurerle maurerle requested a review from gugrimm August 6, 2025 07:21
@kim-mskw
Copy link
Copy Markdown
Contributor

kim-mskw commented Aug 6, 2025

Hi @maurerle, I am a little confused by the PR, from the changes you proposed, I understand that the code already correctly passed silent options via solver_options, so suppress_output() was redundant and could be removed. Is that correct? Otherwise, it does not seem like you actually changed the pass of the silence args to the highs solver.

@kim-mskw kim-mskw merged commit 838ea98 into main Aug 11, 2025
8 of 9 checks passed
@kim-mskw kim-mskw deleted the fix_suppress_highs branch August 11, 2025 08:22
pdockery pushed a commit to pdockery/assume that referenced this pull request Mar 13, 2026
# Pull Request

The `suppress_output` method redirects the output buffers.
This is generally not a good idea, instead, the underlying source of
unwanted output should be tackled.

This PR fixes the output from highs in the redispatch market.

## Related Issue
This fixes assume-framework#619 as this produced errors in Colab.

## Description
There is still a line `Running HiGHS 1.11.0 (git hash: 364c83a):
Copyright (c) 2025 HiGHS under MIT licence terms` which is printed for
every solving.
This is going to be fixed in linopy with
PyPSA/linopy#479

## Changes Proposed
- correctly pass the silence args to the highs solver
- delete now unused suppress_output function
- improve package installation in colab by calling pip less often

## Testing
[Describe the testing you've done, including any specific test cases or
scenarios]

## Checklist
Please check all applicable items:

- [ ] Code changes are sufficiently documented (docstrings, inline
comments, `doc` folder updates)
- [ ] New unit tests added for new features or bug fixes
- [ ] Existing tests pass with the changes
- [ ] Reinforcement learning examples are operational (for DRL-related
changes)
- [ ] Code tested with both local and Docker databases
- [ ] Code follows project style guidelines and best practices
- [ ] Changes are backwards compatible, or deprecation notices added
- [ ] New dependencies added to `pyproject.toml`
- [ ] A note for the release notes `doc/release_notes.rst` of the
upcoming release is included
- [x] Consent to release this PR's code under the GNU Affero General
Public License v3.0

## Additional Notes (if applicable)
[Any additional information, concerns, or areas you want reviewers to
focus on]

## Screenshots (if applicable)
[Add screenshots to demonstrate visual changes]
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.

Error when running 10_DSU_and_flexibility

2 participants