diff options
author | Pal Barta <bartapal.hu@gmail.com> | 2022-08-10 11:20:50 -0400 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2022-08-10 19:08:32 -0600 |
commit | f41020bf8c8171da4472b92959e91b4029dc8cff (patch) | |
tree | 175fbeee6a5dbb8e19bd8daa18c4fceb4528217a | |
parent | 72b98a0d42c9e52cd2650cf357bc0ccb20264b27 (diff) | |
download | numpy-f41020bf8c8171da4472b92959e91b4029dc8cff.tar.gz |
TST: fix test_linear_interpolation_formula_symmetric
The lerp test compared the output of the original and the symmetric
functions by using basic assertion. Double precision errors could
accumulate in a way that the 2 outputs mismatch by epsilon.
For more information on the precision issue, see #22073
Fix: use assert_allclose instead for float comparison.
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 09e161956..865b91965 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -3574,7 +3574,7 @@ class TestLerp: # double subtraction is needed to remove the extra precision of t < 0.5 left = nfb._lerp(a, b, 1 - (1 - t)) right = nfb._lerp(b, a, 1 - t) - assert left == right + assert_allclose(left, right) def test_linear_interpolation_formula_0d_inputs(self): a = np.array(2) |