Skip to content

Commit

Permalink
Fix test tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed May 28, 2024
1 parent e0d48ef commit d4325f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/structure/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def test_index_distance_periodic_triclinic(shift, angles):
traj.unitcell_vectors = array.box[np.newaxis, :, :] / 10
# Nanometers to Angstrom
mdtraj_dist = mdtraj.compute_distances(traj, dist_indices)[0] * 10
ind = np.where(~np.isclose(ref_dist, mdtraj_dist, atol=1e-5, rtol=1e-3))[0]
assert np.allclose(ref_dist, mdtraj_dist, atol=1e-5, rtol=1e-3)
ind = np.where(~np.isclose(ref_dist, mdtraj_dist, atol=2e-5, rtol=1e-3))[0]
assert np.allclose(ref_dist, mdtraj_dist, atol=2e-5, rtol=1e-3)

# Compare with shifted variant
array.coord += shift
Expand All @@ -235,7 +235,7 @@ def test_index_distance_periodic_triclinic(shift, angles):
test_dist = struc.index_distance(array, dist_indices, periodic=True)
except MemoryError:
pytest.skip("Not enough memory")
assert np.allclose(test_dist, ref_dist, atol=1e-5)
assert np.allclose(test_dist, ref_dist, atol=2e-5)


def test_index_functions():
Expand Down

0 comments on commit d4325f6

Please sign in to comment.