Skip to content

Commit

Permalink
Fixed tests since Numpy 1.18 deprecation of non-int num arguments for…
Browse files Browse the repository at this point in the history
… linspace. (#3655)
  • Loading branch information
trexfeathers committed Feb 11, 2020
1 parent c9506e6 commit 4410e56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/unit/analysis/cartography/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4410e56

Please sign in to comment.