Skip to content

Fix 5540 - #5546

Open
Srikar025 wants to merge 7 commits into
MDAnalysis:developfrom
Srikar025:fix-5540
Open

Srikar025 wants to merge 7 commits into
MDAnalysis:developfrom
Srikar025:fix-5540

Conversation

@Srikar025

@Srikar025 Srikar025 commented Nov 11, 2026 •

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

read-the-docs-community Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

@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.94%. Comparing base (951f305) to head (d8bf29c).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5546   +/-   ##
========================================
  Coverage    93.93%   93.94%           
========================================
  Files          184      184           
  Lines        22675    22681    +6     
  Branches      3227     3229    +2     
========================================
+ Hits         21300    21307    +7     
+ Misses         915      914    -1     
  Partials       460      460           

☔ 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

Copy link
Copy Markdown
Author

please have a look at this ive completed the fix and added a regression test covering early iterator closure when ProgressBar is disabled.
The test also simulates the yield from behaviour independently of the installed tqdm version.
All available CI checks have passed, except the macOS ARM64 job, which was cancelled due to an unsupported runner configuration.

This branch has not been deployed

No deployments
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