Skip to content

Commit

Permalink
Numpy 2 fix (SciTools#426)
Browse files Browse the repository at this point in the history
* Updated environment lockfiles

* fix tests for numpy 2
  • Loading branch information
stephenworsley authored Oct 30, 2024
1 parent fd38807 commit d4e3f11
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 326 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
Loading

0 comments on commit d4e3f11

Please sign in to comment.