Skip to content

Commit

Permalink
Relax tolerance of some tests for numpy 1.22
Browse files Browse the repository at this point in the history
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 numpy/numpy#19478
  • Loading branch information
mhvk committed Jan 2, 2022
1 parent dc588da commit 400e9d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion astropy/coordinates/tests/test_matching.py
Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions astropy/coordinates/tests/test_sky_coord.py
Expand Up @@ -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)

0 comments on commit 400e9d2

Please sign in to comment.