-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
imdclient/imdclient/tests/test_namd.py
Lines 107 to 127 in 9e906f0
| # Since NAMD does not write velocities, forces to the DCD file, we need to do so seperately by extracting that info from theri respective DCD files | |
| # Compare velocities | |
| def test_compare_imd_to_true_traj_vel(self, imd_u, true_u_vel, first_frame): | |
| for i in range(first_frame, len(true_u_vel.trajectory)): | |
| assert_allclose_with_logging( | |
| # Unit conversion | |
| true_u_vel.trajectory[i].positions * 20.45482706, | |
| imd_u.trajectory[i - first_frame].velocities, | |
| atol=1e-03, | |
| ) | |
| # Compare forces | |
| def test_compare_imd_to_true_traj_forces( | |
| self, imd_u, true_u_force, first_frame | |
| ): | |
| for i in range(first_frame, len(true_u_force.trajectory)): | |
| assert_allclose_with_logging( | |
| true_u_force.trajectory[i].positions, | |
| imd_u.trajectory[i - first_frame].forces, | |
| atol=1e-03, | |
| ) |
Currently, due to NAMD's inherent output scheme (writing positions, velocities and force information to separate files), the tests for each have been dealt with separately by creating universes for each as highlighted in the code above.
A better and cleaner alternative would be read all the information into a single universe by reading information for all 3 files. The most efficient way to do this needs to be figured out. The most naive approach would be to create 3 separate universes and copy relevant data from two of them into the third.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels