Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new python versions #880

Merged
merged 23 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion perses/tests/test_coordinate_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def test_openmm_dihedral():
msg += '_internal_to_cartesian generated positions for: {}\n'.format(phi)
msg += 'OpenMM: {}\n'.format(openmm_phi)
msg += 'positions: {}'.format(positions)
assert np.linalg.norm(openmm_phi - phi) < TORSION_TOLERANCE, msg

delta = abs(openmm_phi - phi)
error = min(delta, 2*np.pi - delta)
assert error < TORSION_TOLERANCE, msg
Comment on lines +105 to +108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these changes work, we should include some kind of Fixes #879 in the PR, I suppose.


# Check that _cartesian_to_internal agrees
rtp, detJ = geometry_engine._cartesian_to_internal(xyz_atom1, bond_position, angle_position, torsion_position)
Expand Down
6 changes: 5 additions & 1 deletion perses/tests/test_geometry_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ def test_torsion_scan():
for i, phi in enumerate(phis):
xyz_ge = xyzs[i]
r_new, theta_new, phi_new = _get_internal_from_omm(xyz_ge, testsystem.positions[1], testsystem.positions[2], testsystem.positions[3])
if np.abs(phi_new - phi) > TOLERANCE:

delta = abs(phi_new - phi)
error = min(delta, 2*np.pi-delta)

if error < TORSION_TOLERANCE:
raise Exception("Torsion scan did not match OpenMM torsion")
if np.abs(r_new - r) > TOLERANCE or np.abs(theta_new - theta) > TOLERANCE:
raise Exception("Theta or r was disturbed in torsion scan.")
Expand Down