Skip to content

ENH: support reading box vectors from TPR files - #5466

Open
AkshitBoora wants to merge 4 commits into
MDAnalysis:developfrom
AkshitBoora:fix-tpr-box-5375
Open

ENH: support reading box vectors from TPR files#5466
AkshitBoora wants to merge 4 commits into
MDAnalysis:developfrom
AkshitBoora:fix-tpr-box-5375

Conversation

@AkshitBoora

Copy link
Copy Markdown

Fixes #5375

Changes made in this Pull Request:

  • Modified TPRReader._read_first_frame() in package/MDAnalysis/coordinates/TPR.py to capture the Box tuple from extract_box_info() and set ts.dimensions = triclinic_box(*box_info.size).
  • Added unit conversion (convert_units=True converts nm to Å; convert_units=False preserves nm) following MDAnalysis coordinate reader standards.
  • Added comprehensive unit tests in testsuite/MDAnalysisTests/coordinates/test_tpr.py for single (mda.Universe(tpr)) and double (mda.Universe(tpr, tpr)) TPR universes across different GROMACS TPR versions.
  • Updated package/CHANGELOG.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: No

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • 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.

Akshit Boora added 2 commits August 18, 2026 16:23
Add a new 'subselection' keyword argument to AlignTraj.__init__ that
accepts a selection string or AtomGroup. When provided, only those atoms
are written to the output trajectory (enabling a performance/memory
trade-off), while the superposition/RMSD fit is still computed using the
atoms defined by 'select'.

Also add a module-level guide in MDAnalysis.analysis.align documenting
three usage patterns for aligning sub-systems with different memory
characteristics.

Changes:
- package/MDAnalysis/analysis/align.py: add subselection param + docs
- testsuite/MDAnalysisTests/analysis/test_align.py: 4 new unit tests
- package/CHANGELOG: Enhancements + Documentation entries
- package/AUTHORS: add Akshit Boora

Closes MDAnalysis#5380
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.86%. Comparing base (c882e5c) to head (8308d09).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5466      +/-   ##
===========================================
- Coverage    93.87%   93.86%   -0.02%     
===========================================
  Files          182      182              
  Lines        22522    22534      +12     
  Branches      3206     3209       +3     
===========================================
+ Hits         21143    21151       +8     
- Misses         917      920       +3     
- Partials       462      463       +1     

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

@read-the-docs-community

read-the-docs-community Bot commented Sep 2, 2026

Copy link
Copy Markdown

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.

ENH: support reading box vectors from TPR files

1 participant