Fix the outputs to stdout/stderr - #321
Merged
Merged
Conversation
…o sys.stdout instead of stderr
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts runtime output streams to better separate “normal” output from errors in batch/cluster environments by moving tqdm progress bars (and low-severity logs) away from stderr.
Changes:
- Added a
struphy.utils.progressshim that configurestqdmto write tosys.stdoutby default. - Updated multiple modules to import
tqdmfromstruphy.utils.progressinstead of directly fromtqdm. - Updated
struphylogger configuration to route DEBUG/INFO to stdout and WARNING+ to stderr, and to log more verbosely tostruphy.log.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/struphy/utils/progress.py | Introduces a stdout-targeting tqdm wrapper for consistent progress bar output. |
| src/struphy/simulation/sim.py | Switches to the new tqdm wrapper and reformats progress bar construction. |
| src/struphy/post_processing/post_processing_tools.py | Uses the new stdout tqdm import path. |
| src/struphy/post_processing/orbits/orbits_tools.py | Uses the new stdout tqdm import path. |
| src/struphy/diagnostics/diagn_tools.py | Uses the new stdout tqdm import path. |
| src/struphy/init.py | Adds stdout/stderr split logging handlers and adjusts file handler verbosity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
Author
|
There are still a few messages that appear in the edit: moved these to logger.info in bd67126 |
max-models
marked this pull request as ready for review
August 4, 2026 09:41
spossann
approved these changes
Aug 4, 2026
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.
stdouthandler which uses aBelowWarningFilterDEBUG/INFO go to stdout, WARNING and above to stderr; records that pass the logger level are also written to the log file.
This means the levels for the different loggers are no longer the same, and these lines were therefore removed: