From dfa7ed03b9fd6cd5a432511d874b9c68662a7451 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Mon, 10 Feb 2020 15:34:26 +0000 Subject: [PATCH] Fixed tests since Numpy 1.18 deprecation of non-int num arguments for linspace. --- .../test_regrid_area_weighted_rectilinear_src_and_grid.py | 3 ++- lib/iris/tests/unit/analysis/cartography/test_project.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py index 4721aa44ee..7f8ad4b551 100644 --- a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py +++ b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py @@ -108,8 +108,9 @@ def _resampled_coord(coord, samplefactor): delta = 0.00001 * np.sign(upper - lower) * abs(bounds[0, 1] - bounds[0, 0]) lower = lower + delta upper = upper - delta + samples = int(len(bounds) * samplefactor) new_points, step = np.linspace( - lower, upper, len(bounds) * samplefactor, endpoint=False, retstep=True + lower, upper, samples, endpoint=False, retstep=True ) new_points += step * 0.5 new_coord = coord.copy(points=new_points) diff --git a/lib/iris/tests/unit/analysis/cartography/test_project.py b/lib/iris/tests/unit/analysis/cartography/test_project.py index d617e33898..33edfb5675 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_project.py +++ b/lib/iris/tests/unit/analysis/cartography/test_project.py @@ -81,7 +81,7 @@ def test_bad_resolution_negative(self): @tests.skip_data def test_bad_resolution_non_numeric(self): cube = low_res_4d() - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): project(cube, ROBINSON, nx=200, ny="abc") @tests.skip_data