Skip to content

Commit

Permalink
Fix interpolator tests with scipy 1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Apr 12, 2024
1 parent 2e92035 commit 3ff7702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions geotiepoints/tests/test_interpolator.py
Expand Up @@ -349,12 +349,12 @@ def test_interpolate(self, grid_interpolator):
fine_x = np.arange(16)
fine_y = np.arange(32)

res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic")
res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic_legacy")
np.testing.assert_allclose(res, self.expected, atol=2e-9)

def test_interpolate_slices(self, grid_interpolator):
"""Test that interpolation from slices is working."""
res = grid_interpolator.interpolate_slices((slice(0, 32), slice(0, 16)), method="cubic")
res = grid_interpolator.interpolate_slices((slice(0, 32), slice(0, 16)), method="cubic_legacy")
np.testing.assert_allclose(res, self.expected, atol=2e-9)

@pytest.mark.parametrize("chunks, expected_chunks", [(10, (10, 10)),
Expand All @@ -369,7 +369,7 @@ def test_interpolate_dask(self, grid_interpolator, chunks, expected_chunks):
with mock.patch.object(grid_interpolator,
"interpolate_numpy",
wraps=grid_interpolator.interpolate_numpy) as interpolate:
res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic", chunks=chunks)
res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic_legacy", chunks=chunks)
assert not interpolate.called

assert isinstance(res, da.Array)
Expand All @@ -395,5 +395,5 @@ def test_interpolate_preserves_dtype(self):
fine_x = np.arange(16)
fine_y = np.arange(32)

res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic")
res = grid_interpolator.interpolate((fine_y, fine_x), method="cubic_legacy")
assert res.dtype == data.dtype

0 comments on commit 3ff7702

Please sign in to comment.