Skip to content

Fix ProgressBar closing the trajectory when disabled (Fixes #5540) - #5545

Closed
Srikar025 wants to merge 5 commits into
MDAnalysis:developfrom
Srikar025:develop
Closed

Srikar025 wants to merge 5 commits into
MDAnalysis:developfrom
Srikar025:develop

Conversation

@Srikar025

Copy link
Copy Markdown

Fixes #5540

Changes made in this Pull Request

  • ProgressBar.__iter__() now uses a regular for loop instead of
    yield from when the progress display is disabled. yield from forwards
    generator closure to the wrapped iterator, which closed the
    TrajectoryReader when iteration was interrupted (tqdm >= 4.70).
  • Behavior with the progress display enabled is unchanged.
  • Added a regression test checking that the trajectory can still be read
    after a disabled ProgressBar loop is exited early.
  • Added a package/CHANGELOG entry under Fixes and added myself to
    package/AUTHORS.

Testing

  • python -m pytest testsuite/MDAnalysisTests/lib/test_log.py -q: 4 passed
  • python -m pytest testsuite/MDAnalysisTests/lib -q: 9950 passed, 3 skipped

LLM / AI generated code disclosure

I used AI to help investigate the bug and understand its root cause, and to
help draft this PR description.

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added? (not needed, internal bug fix)
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS? (If it is not, add it!)
  • I have read and understand the current AI Policy
  • LLM/AI disclosure was updated.

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 MDAnalysis | 🛠️ Build #35819262 | 📁 Comparing 6943eeb against latest (bd5aa91)

  🔍 Preview build  

3 files changed
± index.html
± documentation_pages/analysis/wbridge_analysis.html
± _modules/MDAnalysis/lib/log.html

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.57%. Comparing base (bd5aa91) to head (6943eeb).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5545      +/-   ##
===========================================
- Coverage    93.93%   93.57%   -0.36%     
===========================================
  Files          184      184              
  Lines        22662    22668       +6     
  Branches      3223     3225       +2     
===========================================
- Hits         21287    21212      -75     
- Misses         915      987      +72     
- Partials       460      469       +9     

☔ View full report in Codecov by Harness.
📢 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.

@Srikar025 Srikar025 closed this Nov 11, 2026
@Srikar025

Copy link
Copy Markdown
Author

opening another

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.

tqdm>= 4.70 changes how iterators are handled

1 participant