Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecations from NumPy #1122

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cartopy/img_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def mesh_projection(projection, nx, ny,
----------
projection
A :class:`~cartopy.crs.Projection` instance.
nx
nx: int
The number of sample points in the projection x-direction.
ny
ny: int
The number of sample points in the projection y-direction.
x_extents: optional
The (lower, upper) x-direction extent of the projection.
Expand Down
3 changes: 2 additions & 1 deletion lib/cartopy/io/ogc_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def _warped_located_image(image, source_projection, source_extent,
source_proj=source_projection,
source_extent=source_extent,
target_proj=output_projection,
target_res=target_resolution,
target_res=np.asarray(target_resolution,
dtype=int),
target_extent=output_extent,
mask_extrapolated=True)

Expand Down
4 changes: 2 additions & 2 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,9 @@ def _regrid_shape_aspect(self, regrid_shape, target_extent):
x_range, y_range = np.diff(target_extent)[::2]
desired_aspect = x_range / y_range
if x_range >= y_range:
regrid_shape = (target_size * desired_aspect, target_size)
regrid_shape = (int(target_size * desired_aspect), target_size)
else:
regrid_shape = (target_size, target_size / desired_aspect)
regrid_shape = (target_size, int(target_size / desired_aspect))
return regrid_shape

def imshow(self, img, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions lib/cartopy/tests/test_polygon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2011 - 2017, Met Office
# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_symmetry(self):

# For each region, check if the number of increasing steps is roughly
# equal to the number of decreasing steps.
for i in range(boundary[0], regions.max(), 2):
for i in range(int(boundary[0]), regions.max(), 2):
indices = np.where(regions == i)
x = xy[indices, 0]
delta = np.diff(x)
Expand Down