@@ -105,7 +105,7 @@ def get_polygon_to_contain(self):
105105 from shapely .geometry import Polygon
106106
107107 x , y = self .area_to_contain .get_edge_bbox_in_projection_coordinates (10 )
108- poly = Polygon (zip (* self ._source_transformer .transform (x , y )))
108+ poly = Polygon (zip (* self ._source_transformer .transform (x , y ), strict = True ))
109109 return poly
110110
111111 def get_slices_from_polygon (self , poly ):
@@ -121,7 +121,7 @@ def get_slices_from_polygon(self, poly):
121121 @staticmethod
122122 def _assemble_slices (chunk_slices ):
123123 """Assemble slices to one slice per dimension."""
124- lines , cols = zip (* chunk_slices )
124+ lines , cols = zip (* chunk_slices , strict = True )
125125 line_slice = slice (min (slc .start for slc in lines ), max (slc .stop for slc in lines ))
126126 col_slice = slice (min (slc .start for slc in cols ), max (slc .stop for slc in cols ))
127127 slices = col_slice , line_slice
@@ -132,7 +132,7 @@ def _get_chunk_polygons_for_swath_to_crop(self, swath_to_crop):
132132 from shapely .geometry import Polygon
133133
134134 for (lons , lats ), (line_slice , col_slice ) in _get_chunk_bboxes_for_swath_to_crop (swath_to_crop ):
135- smaller_poly = Polygon (zip (* self ._target_transformer .transform (lons , lats )))
135+ smaller_poly = Polygon (zip (* self ._target_transformer .transform (lons , lats ), strict = True ))
136136 yield (smaller_poly , (line_slice , col_slice ))
137137
138138
@@ -176,14 +176,14 @@ def get_polygon_to_contain(self):
176176 if self .area_to_crop .is_geostationary :
177177 x_geos , y_geos = get_geostationary_bounding_box_in_proj_coords (self .area_to_crop , 360 )
178178 x_geos , y_geos = self ._source_transformer .transform (x_geos , y_geos , direction = TransformDirection .INVERSE )
179- geos_poly = Polygon (zip (x_geos , y_geos ))
180- poly = Polygon (zip (x , y ))
179+ geos_poly = Polygon (zip (x_geos , y_geos , strict = True ))
180+ poly = Polygon (zip (x , y , strict = True ))
181181 poly = poly .intersection (geos_poly )
182182 if poly .is_empty :
183183 raise IncompatibleAreas ("No slice on area." )
184- x , y = zip (* poly .exterior .coords )
184+ x , y = zip (* poly .exterior .coords , strict = True )
185185
186- return Polygon (zip (* self ._source_transformer .transform (x , y )))
186+ return Polygon (zip (* self ._source_transformer .transform (x , y ), strict = True ))
187187
188188 def get_slices_from_polygon (self , poly_to_contain ):
189189 """Get the slices based on the polygon."""
@@ -201,7 +201,9 @@ def get_slices_from_polygon(self, poly_to_contain):
201201 raise InvalidArea ("Invalid area" ) from err
202202 from shapely .geometry import Polygon
203203
204- poly_to_crop = Polygon (zip (* self .area_to_crop .get_edge_bbox_in_projection_coordinates (frequency = 10 )))
204+ poly_to_crop = Polygon (zip (
205+ * self .area_to_crop .get_edge_bbox_in_projection_coordinates (frequency = 10 ),
206+ strict = True ))
205207 if not poly_to_crop .intersects (buffered_poly ):
206208 raise IncompatibleAreas ("Areas not overlapping." )
207209 bounds = self ._sanitize_polygon_bounds (bounds )
@@ -238,7 +240,7 @@ def _enumerate_chunk_slices(chunks):
238240 """Enumerate chunks with slices."""
239241 for position in np .ndindex (tuple (map (len , (chunks )))):
240242 slices = []
241- for pos , chunk in zip (position , chunks ):
243+ for pos , chunk in zip (position , chunks , strict = True ):
242244 chunk_size = chunk [pos ]
243245 offset = sum (chunk [:pos ])
244246 slices .append (slice (offset , offset + chunk_size ))
0 commit comments