Skip to content

Commit

Permalink
FIX: Use allclose instead of assert equal
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 committed Sep 29, 2023
1 parent 1801df7 commit 41a6d7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/xradar/test_accessor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import xradar as xd
from numpy.testing import assert_almost_equal
from numpy.testing import assert_allclose
from open_radar_data import DATASETS

import pyart
Expand Down Expand Up @@ -54,5 +54,7 @@ def test_grid(filename=filename):
grid_limits=((2000, 2000), (-100_000.0, 100_000.0), (-100_000.0, 100_000.0)),
fields=["DBZ"],
)
assert_almost_equal(grid.x["data"], np.arange(-100_000, 120_000, 20_000))
assert_almost_equal(grid.fields["DBZ"]["data"][0, -1, 0], np.array(0.4243435))
assert_allclose(grid.x["data"], np.arange(-100_000, 120_000, 20_000))
assert_allclose(
grid.fields["DBZ"]["data"][0, -1, 0], np.array(0.4243435), rtol=1e-03
)

0 comments on commit 41a6d7d

Please sign in to comment.