From 400e9d288859049f8561c0f6da2ff67dfe57284d Mon Sep 17 00:00:00 2001 From: Marten van Kerkwijk Date: Sat, 1 Jan 2022 14:58:15 -0500 Subject: [PATCH] Relax tolerance of some tests for numpy 1.22 Most likely as a consequence of numpy now supporting the faster but slightly less precise Intel Short Vector Math Library (SVML), some of our tests are failing, in ways that are not really interesting. So, up the tolerance slightly. See https://github.com/numpy/numpy/pull/19478 --- astropy/coordinates/tests/test_matching.py | 2 +- astropy/coordinates/tests/test_sky_coord.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/astropy/coordinates/tests/test_matching.py b/astropy/coordinates/tests/test_matching.py index e0f9f1a79a76..248b78c7ca06 100644 --- a/astropy/coordinates/tests/test_matching.py +++ b/astropy/coordinates/tests/test_matching.py @@ -167,7 +167,7 @@ def test_search_around(): idx1_0p05deg, idx2_0p05deg, d2d_0p05deg, d3d_0p05deg = search_around_sky(coo1, coo2, 0.05*u.deg) assert list(zip(idx1_1deg, idx2_1deg)) == [(0, 2), (0, 3), (1, 1), (1, 2)] - assert d2d_1deg[0] == 1.0*u.deg + assert_allclose(d2d_1deg[0], 1.0*u.deg, atol=1e-14*u.deg, rtol=0) assert_allclose(d2d_1deg, [1, 0, .1, .9]*u.deg) assert list(zip(idx1_0p05deg, idx2_0p05deg)) == [(0, 3)] diff --git a/astropy/coordinates/tests/test_sky_coord.py b/astropy/coordinates/tests/test_sky_coord.py index 47619f6a24e2..f413d20a3519 100644 --- a/astropy/coordinates/tests/test_sky_coord.py +++ b/astropy/coordinates/tests/test_sky_coord.py @@ -1886,10 +1886,10 @@ def test_match_to_catalog_3d_and_sky(): idx, angle, quantity = cfk5_J1950.match_to_catalog_3d(cfk5_default) npt.assert_array_equal(idx, [0, 1, 2, 3]) - assert_allclose(angle, 0*u.deg, atol=1e-15*u.deg, rtol=0) + assert_allclose(angle, 0*u.deg, atol=2e-15*u.deg, rtol=0) assert_allclose(quantity, 0*u.kpc, atol=1e-15*u.kpc, rtol=0) idx, angle, distance = cfk5_J1950.match_to_catalog_sky(cfk5_default) npt.assert_array_equal(idx, [0, 1, 2, 3]) - assert_allclose(angle, 0 * u.deg, atol=1e-15*u.deg, rtol=0) - assert_allclose(distance, 0*u.kpc, atol=1e-15*u.kpc, rtol=0) + assert_allclose(angle, 0 * u.deg, atol=2e-15*u.deg, rtol=0) + assert_allclose(distance, 0*u.kpc, atol=2e-15*u.kpc, rtol=0)