Skip to content

Commit

Permalink
previous fix didn't work - switch to almost_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Jan 6, 2025
1 parent c22ad94 commit beb1233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spectral_cube/tests/test_spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,8 +1536,8 @@ def test_oned_collapse_beams(data_sdav_beams, use_dask):
spec = cube.mean(axis=(1,2))
assert isinstance(spec, VaryingResolutionOneDSpectrum)
# data has a redundant 1st axis
# to avoid epsilon-level differences between nanmean and mean, use nanmean
np.testing.assert_equal(spec.value, np.nanmean(data, axis=(1,2,3)))
# we changed to assert_almost_equal in 2025 because, for no known reason, epsilon-level differences crept in
np.testing.assert_almost_equal(spec.value, np.nanmean(data, axis=(1,2,3)))
assert cube.unit == spec.unit
assert spec.header['BUNIT'] == cube.header['BUNIT']

Expand Down

0 comments on commit beb1233

Please sign in to comment.