|
31 | 31 | import matplotlib |
32 | 32 | import matplotlib.pyplot as plt |
33 | 33 |
|
34 | | -from numpy.testing import assert_almost_equal, assert_equal |
| 34 | +from numpy.testing import assert_equal |
35 | 35 |
|
36 | 36 | from MDAnalysisTests.datafiles import Plength, TRZ_psf, TRZ |
37 | 37 |
|
@@ -73,10 +73,10 @@ def test_run(self, p_run): |
73 | 73 | assert len(p_run.results.bond_autocorrelation) == 280 |
74 | 74 |
|
75 | 75 | def test_lb(self, p_run): |
76 | | - assert_almost_equal(p_run.results.lb, 1.485, 3) |
| 76 | + assert p_run.results.lb == pytest.approx(1.485, abs=1e-3) |
77 | 77 |
|
78 | 78 | def test_fit(self, p_run): |
79 | | - assert_almost_equal(p_run.results.lp, 6.504, 3) |
| 79 | + assert p_run.results.lp == pytest.approx(6.504, abs=1e-3) |
80 | 80 | assert len(p_run.results.fit) == len( |
81 | 81 | p_run.results.bond_autocorrelation |
82 | 82 | ) |
@@ -124,7 +124,7 @@ def test_fit_noisy(self): |
124 | 124 |
|
125 | 125 | a = polymer.fit_exponential_decay(self.x, y2) |
126 | 126 |
|
127 | | - assert_almost_equal(a, self.a_ref, decimal=3) |
| 127 | + assert a == pytest.approx(self.a_ref, abs=1e-3) |
128 | 128 | # assert np.rint(a) == self.a_ref |
129 | 129 |
|
130 | 130 |
|
|
0 commit comments