Skip to content

Commit

Permalink
fix tests for numpy 2
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Oct 30, 2024
1 parent 45d0db3 commit d8d4248
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions esmf_regrid/tests/unit/experimental/io/test_round_tripping.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_grid_to_mesh_round_trip(tmp_path, method, regridder):
assert np.array_equal(original_matrix.todense(), loaded_matrix.todense())

# Demonstrate regridding still gives the same results.
src_data = ma.arange(np.product(src.data.shape)).reshape(src.data.shape)
src_data = ma.arange(np.prod(src.data.shape)).reshape(src.data.shape)
src_data[0, 0] = ma.masked
src.data = src_data
# TODO: make this a cube comparison when mesh comparison becomes available.
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_grid_to_mesh_curvilinear_round_trip(tmp_path, regridder):
_compare_ignoring_var_names(original_rg._src[1], loaded_rg._src[1])

# Demonstrate regridding still gives the same results.
src_data = ma.arange(np.product(src.data.shape)).reshape(src.data.shape)
src_data = ma.arange(np.prod(src.data.shape)).reshape(src.data.shape)
src_data[0, 0] = ma.masked
src.data = src_data
# TODO: make this a cube comparison when mesh comparison becomes available.
Expand Down Expand Up @@ -341,7 +341,7 @@ def test_mesh_to_grid_round_trip(tmp_path, method, regridder):
assert np.array_equal(original_matrix.todense(), loaded_matrix.todense())

# Demonstrate regridding still gives the same results.
src_data = ma.arange(np.product(src.data.shape)).reshape(src.data.shape)
src_data = ma.arange(np.prod(src.data.shape)).reshape(src.data.shape)
src_data[0] = ma.masked
src.data = src_data
original_result = original_rg(src).data
Expand Down Expand Up @@ -416,7 +416,7 @@ def test_mesh_to_grid_curvilinear_round_trip(tmp_path, regridder):
_compare_ignoring_var_names(original_rg._tgt[1], loaded_rg._tgt[1])

# Demonstrate regridding still gives the same results.
src_data = ma.arange(np.product(src.data.shape)).reshape(src.data.shape)
src_data = ma.arange(np.prod(src.data.shape)).reshape(src.data.shape)
src_data[0] = ma.masked
src.data = src_data
original_result = original_rg(src).data
Expand Down

0 comments on commit d8d4248

Please sign in to comment.