Skip to content

Commit

Permalink
Ensure PlateCarree._bbox_and_offset returns list of floats
Browse files Browse the repository at this point in the history
Ensures doctest pass
  • Loading branch information
e-k-m committed Jun 20, 2024
1 parent e5fa2be commit 9bf25b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ def _bbox_and_offset(self, other_plate_carree):
>>> src = ccrs.PlateCarree(central_longitude=10)
>>> bboxes, offset = ccrs.PlateCarree()._bbox_and_offset(src)
>>> print(bboxes)
[[-180, -170.0], [-170.0, 180]]
[[-180, -170.0], [-170.0, 180.0]]
>>> print(offset)
10.0
Expand All @@ -1364,15 +1364,15 @@ def _bbox_and_offset(self, other_plate_carree):
lon_lower_bound_1 = (other_plate_carree.x_limits[0] + lon_0_offset)

if lon_lower_bound_1 < self.x_limits[0]:
lon_lower_bound_1 += np.diff(self.x_limits)[0]
lon_lower_bound_1 += float(np.diff(self.x_limits)[0])

lon_lower_bound_0, lon_lower_bound_1 = sorted(
[lon_lower_bound_0, lon_lower_bound_1])

bbox = [[lon_lower_bound_0, lon_lower_bound_1],
[lon_lower_bound_1, lon_lower_bound_0]]

bbox[1][1] += np.diff(self.x_limits)[0]
bbox[1][1] += float(np.diff(self.x_limits)[0])

return bbox, lon_0_offset

Expand Down

0 comments on commit 9bf25b0

Please sign in to comment.