Skip to content

tests: add test for DumpReader ValueError when convention not in timestep - #5306

Open
xovishnukosuri wants to merge 1 commit into
MDAnalysis:developfrom
xovishnukosuri:fix-5127-lammps-dumpreader-missing-convention-test
Open

xovishnukosuri wants to merge 1 commit into
MDAnalysis:developfrom
xovishnukosuri:fix-5127-lammps-dumpreader-missing-convention-test

Conversation

@xovishnukosuri

@xovishnukosuri xovishnukosuri commented Mar 14, 2026

Copy link
Copy Markdown

What this does

Closes #5127.

DumpReader._read_next_timestep has two paths that raise ValueError when coordinate columns are missing:

  1. auto convention with no coordinate columns at all — tested by test_no_coordinate_info.
  2. A specific convention is requested (e.g. "unscaled") but the timestep does not contain matching columns — untested.

This PR adds test_missing_convention_in_timestep to cover the second path. It uses LAMMPSDUMP (wat.lammpstrj.bz2), which contains only scaled coordinates (xs ys zs), and requests lammps_coordinate_convention="unscaled". The reader cannot find x y z columns and raises:

ValueError: No coordinates following convention unscaled found in timestep

Test plan

  • New test test_missing_convention_in_timestep passes
  • Full test_lammps.py suite passes (157 passed, 0 failures)

Related issue

Fixes #5127


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

…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

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (50dc512) to head (c847af6).

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

missing test for LAMMPS DumpReader for ValueError when missing coordinates

1 participant