Parse input files for DT when not in traj#71
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to parse the DT value from input files for GROMACS and LAMMPS using regular expressions, and removes obsolete code related to testing for time, step, and dt.
- Updated test files for NAMD, LAMMPS, and GROMACS to use regex extraction for dt.
- Removed unused fixtures and refactored test_compare_imd_to_true_traj to simplify dt handling.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| imdclient/tests/test_namd.py | Reformatted logger formatter and test function definition style |
| imdclient/tests/test_lammps.py | Added regex-based dt extraction and reformatted formatter setup |
| imdclient/tests/test_gromacs.py | Added dt fixture using regex for mdp file and reformatted logger |
| imdclient/tests/base.py | Refactored dt handling in tests by replacing old fixtures |
| true_u.trajectory[i].time, | ||
| imd_u.trajectory[i - first_frame].time, | ||
| atol=1e-03, | ||
| ) |
There was a problem hiding this comment.
The call to assert_allclose includes three array arguments; the extra argument (imd_u.trajectory[i - first_frame].dt) should be removed so that the function compares only true_u.trajectory[i].dt and dt.
|
@ljwoods2, two things -
|
|
@amruthesht is there ever a case where dt would change from what the user set it to? Unless there's a clear case that we'd encounter I don't see value in rewriting it, if we ever want to drastically modify these tests in the future to include such a case we can do it then. I'd be happy to swap this PR to make it into your |
|
@ljwoods2 - I can't think think of a specific case that is common so I think it should be fine for now to stick with parsing the input file. However, right now the gmx tests seem to be failing and still using the MDA "transmission dt" for some reason. I can take a stab at it if you want. |
|
@amruthesht that's expected, read the issue description. This doesn't use your minimalreader, so IMD universe is created by dumping stream into a TRR file and then rereading (which loses DT information) |
My bad - I thought you were doing comparisons without dumping it as a TRR. |
Fixes #70
Changes made in this Pull Request:
The GROMACS simulation engine
test_compare_imd_to_true_trajis going to fail until we merge this with #53, which adds MinimalReader and allows keeping the IMD stream's DT value (instead of replacing it with time between transmitted frames as a result of the TRR reader)Same goes for LAMMPS
(sorry for the black diff, apparently when I wrote everything previously I had configured a nonstandard, short max line length in my vscode)
PR Checklist