Skip to content

fix: normalize PersistenceLength by n_frames instead of trajectory n_frames - #5456

Open
shubhrai23 wants to merge 1 commit into
MDAnalysis:developfrom
shubhrai23:fix/issue-5453-persistencelength-frames
Open

fix: normalize PersistenceLength by n_frames instead of trajectory n_frames#5456
shubhrai23 wants to merge 1 commit into
MDAnalysis:developfrom
shubhrai23:fix/issue-5453-persistencelength-frames

Conversation

@shubhrai23

Copy link
Copy Markdown

Resolves #5453

Copilot AI lite review requested due to automatic review settings August 11, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect normalization in PersistenceLength when run(start=..., stop=...) processes only a subset of trajectory frames, ensuring results are normalized by the number of analyzed frames rather than the total trajectory length.

Changes:

  • Normalize results.bond_autocorrelation using self.n_frames (frames actually processed by the analysis run) instead of self._trajectory.n_frames (total frames in the trajectory).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 MDAnalysis | 🛠️ Build #34022012 | 📁 Comparing 8d59a08 against latest (c882e5c)

  🔍 Preview build  

2 files changed
± documentation_pages/analysis/wbridge_analysis.html
± _modules/MDAnalysis/analysis/polymer.html

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.87%. Comparing base (c882e5c) to head (8d59a08).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5456   +/-   ##
========================================
  Coverage    93.87%   93.87%           
========================================
  Files          182      182           
  Lines        22522    22522           
  Branches      3206     3206           
========================================
  Hits         21143    21143           
  Misses         917      917           
  Partials       462      462           

☔ 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.

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.

PersistenceLength.run(start=, stop=) rescales entire results.bond_autocorrelation array by n_frames_processed / n_frames_total_trajectory

2 participants