Add test for DMSReader convert_pos_from_native with non-zero unit cell - #5307
Open
xovishnukosuri wants to merge 2 commits into
Open
xovishnukosuri wants to merge 2 commits into
xovishnukosuri wants to merge 2 commits into
Conversation
…step Closes MDAnalysis#5127. The elif branch in DumpReader._read_next_timestep that raises ValueError when a specific coordinate convention is requested but not present in the file had no test coverage. Add test_missing_convention_in_timestep which uses LAMMPSDUMP (scaled coords only) with lammps_coordinate_convention="unscaled" to trigger the error.
The existing test only uses a DMS file with all-zero cell vectors, so ts.dimensions ends up None and the convert_pos_from_native branch for dimensions was never exercised. Add TestDMSReaderWithBox which builds a minimal DMS SQLite file in tmp_path with a real orthorhombic box and checks that dimensions are read and not None. Closes MDAnalysis#3304 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5307 +/- ##
===========================================
+ Coverage 93.82% 93.84% +0.01%
===========================================
Files 182 182
Lines 22487 22487
Branches 3196 3196
===========================================
+ Hits 21099 21102 +3
+ Misses 925 923 -2
+ Partials 463 462 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3304.
The existing
TestDMSReaderonly loadsadk_closed.dms, which has all-zero global_cell vectors.triclinic_boxconverts those to a zero array,Timestep.dimensionssetter treats that asNone, so the branch atDMS.py:115(if self.ts.dimensions is not None: convert_pos_from_native(ts.dimensions[:3])) was never reached by any test.This PR adds
TestDMSReaderWithBoxwhich:tmp_pathwith a real 30x40x50 Angstrom orthorhombic boxts.dimensions is not NoneTest plan
python -m pytest testsuite/MDAnalysisTests/coordinates/test_dms.py -v— 12 passedpython -m pytest testsuite/MDAnalysisTests/topology/test_dms.py -v— 22 passed🤖 Generated with Claude Code
📚 Documentation preview 📚: https://mdanalysis--5307.org.readthedocs.build/en/5307/