tests: add test for DumpReader ValueError when convention not in timestep - #5306
Open
xovishnukosuri wants to merge 1 commit into
Open
xovishnukosuri wants to merge 1 commit into
xovishnukosuri wants to merge 1 commit 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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5306 +/- ##
===========================================
- Coverage 93.82% 93.81% -0.02%
===========================================
Files 182 182
Lines 22487 22487
Branches 3196 3196
===========================================
- Hits 21099 21096 -3
- Misses 925 927 +2
- Partials 463 464 +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.
What this does
Closes #5127.
DumpReader._read_next_timestephas two paths that raiseValueErrorwhen coordinate columns are missing:autoconvention with no coordinate columns at all — tested bytest_no_coordinate_info."unscaled") but the timestep does not contain matching columns — untested.This PR adds
test_missing_convention_in_timestepto cover the second path. It usesLAMMPSDUMP(wat.lammpstrj.bz2), which contains only scaled coordinates (xs ys zs), and requestslammps_coordinate_convention="unscaled". The reader cannot findx y zcolumns and raises:Test plan
test_missing_convention_in_timesteppassestest_lammps.pysuite passes (157 passed, 0 failures)Related issue
Fixes #5127
📚 Documentation preview 📚: https://mdanalysis--5306.org.readthedocs.build/en/5306/