From 958f8700868a524108131cadb4be578eff418601 Mon Sep 17 00:00:00 2001 From: Manuel Schlund Date: Fri, 2 Dec 2022 10:09:13 +0100 Subject: [PATCH 1/2] Removed test that fails in iris 3.4.0 --- .../preprocessor/_regrid/test_regrid.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/integration/preprocessor/_regrid/test_regrid.py b/tests/integration/preprocessor/_regrid/test_regrid.py index 8a720d461f..32eafb93ae 100644 --- a/tests/integration/preprocessor/_regrid/test_regrid.py +++ b/tests/integration/preprocessor/_regrid/test_regrid.py @@ -264,22 +264,3 @@ def test_regrid__unstructured_nearest_float(self): # Make sure that output is a masked array with correct fill value # (= GLOBAL_FILL_VALUE) np.testing.assert_allclose(result.data.fill_value, GLOBAL_FILL_VALUE) - - def test_regrid__unstructured_nearest_int(self): - """Test unstructured_nearest regridding with cube of ints.""" - self.unstructured_grid_cube.data = np.full((3, 2, 2), 1, dtype=int) - result = regrid(self.unstructured_grid_cube, - self.grid_for_unstructured_nearest, - 'unstructured_nearest') - expected = np.array([[[1]], [[1]], [[1]]]) - np.testing.assert_array_equal(result.data, expected) - - # Make sure that dtype is not preserved (since conversion from float to - # int would be necessary) - assert np.issubdtype(self.unstructured_grid_cube.dtype, np.integer) - assert result.dtype == np.float64 - - # Make sure that output is a masked array with correct fill value - # (= maximum int) - np.testing.assert_allclose(result.data.fill_value, - float(np.iinfo(int).max)) From 6be241abd00db1d4036cb8959d9c1f8124def626 Mon Sep 17 00:00:00 2001 From: Manuel Schlund Date: Fri, 2 Dec 2022 11:19:18 +0100 Subject: [PATCH 2/2] Only removed relevant parts of the test --- .../preprocessor/_regrid/test_regrid.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/preprocessor/_regrid/test_regrid.py b/tests/integration/preprocessor/_regrid/test_regrid.py index 32eafb93ae..c96496d2d8 100644 --- a/tests/integration/preprocessor/_regrid/test_regrid.py +++ b/tests/integration/preprocessor/_regrid/test_regrid.py @@ -264,3 +264,17 @@ def test_regrid__unstructured_nearest_float(self): # Make sure that output is a masked array with correct fill value # (= GLOBAL_FILL_VALUE) np.testing.assert_allclose(result.data.fill_value, GLOBAL_FILL_VALUE) + + def test_regrid__unstructured_nearest_int(self): + """Test unstructured_nearest regridding with cube of ints.""" + self.unstructured_grid_cube.data = np.full((3, 2, 2), 1, dtype=int) + result = regrid(self.unstructured_grid_cube, + self.grid_for_unstructured_nearest, + 'unstructured_nearest') + expected = np.array([[[1]], [[1]], [[1]]]) + np.testing.assert_array_equal(result.data, expected) + + # Make sure that output is a masked array with correct fill value + # (= maximum int) + np.testing.assert_allclose(result.data.fill_value, + float(np.iinfo(int).max))