Skip to content

Conversation

@Dreamstick9
Copy link

@Dreamstick9 Dreamstick9 commented Dec 23, 2025

Fixes #3341

Changes made in this Pull Request:

Implemented logic in MOL2Parser (package/MDAnalysis/coordinates/MOL2.py) to parse @CRYSIN records.

Extracted unit cell dimensions (lengths and angles) from the CRYSIN block and assigned them to ts.dimensions.

Added a new test data file with a CRYSIN record: testsuite/MDAnalysisTests/data/mol2/test_crysin.mol2.

Registered the new test file in testsuite/MDAnalysisTests/datafiles.py.

Added a regression test test_mol2_crysin_dimensions in testsuite/MDAnalysisTests/coordinates/test_mol2.py to verify dimensions are loaded correctly.

PR Checklist
[x] Issue raised/referenced?

[x] Tests updated/added?

[ ] Documentation updated/added?

[ ] package/CHANGELOG file updated?

[ ] Is your name in package/AUTHORS? (If it is not, add it!)

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.


📚 Documentation preview 📚: https://mdanalysis--5187.org.readthedocs.build/en/5187/

@Dreamstick9 Dreamstick9 marked this pull request as draft December 23, 2025 16:05
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.72%. Comparing base (4c12f15) to head (a4c6bb1).

Files with missing lines Patch % Lines
package/MDAnalysis/coordinates/MOL2.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5187      +/-   ##
===========================================
- Coverage    92.72%   92.72%   -0.01%     
===========================================
  Files          180      180              
  Lines        22475    22482       +7     
  Branches      3190     3191       +1     
===========================================
+ Hits         20841    20846       +5     
- Misses        1177     1179       +2     
  Partials       457      457              

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

@Dreamstick9 Dreamstick9 marked this pull request as ready for review December 24, 2025 03:50
@orbeckst
Copy link
Member

@Dreamstick9 can you link to the document that describes the @CRYSIN record? Can you show/link to examples mol2 files found "in the wild" that use it, e.g., from a database?

That may help with reviewing.

Also make sure that you address all points in the checklist (eg, add a note to the docs, add an entry to CHANGELOG). Reviewing PRs takes a lot of time and time is really precious so show reviewers that you've done all the necessary work.

@Dreamstick9
Copy link
Author

I implemented this based on the official Tripos mol2 file format specification, the @crysin record is defined the the standard manual in page 17 of the pdf(https://github.com/UnixJunkie/mol2-file-format-spec/blob/master/mol2.pdf). the test case added in mol2_crysin was for this specification. this record is the standard method for defining periodic boundary conditions in the format (see "Data Record Format" in the spec).
i have updated the CHANGELOG and AUTHORS.

Thanks for the review @orbeckst

@Dreamstick9 Dreamstick9 force-pushed the feat/3341-add-crysin-support branch from 378627a to edfa9c3 Compare January 16, 2026 13:06
@orbeckst orbeckst self-assigned this Jan 16, 2026
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.

Proposal: Add support for @<TRIPOS>CRYSIN MOL2 records

2 participants