Skip to content

Commit

Permalink
Don't use dtype=object when converting arrays to pass to shapely 2 (#103
Browse files Browse the repository at this point in the history
)

* Don't use dtype=object when converting arrays to pass to shapely 2

* Force shapely>=2.0 in CI

* Increase CI timeout

* Revert shapely pin
  • Loading branch information
ianthomas23 authored Dec 15, 2022
1 parent 26cfd93 commit b3d7ba1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: [3.7, 3.8, 3.9, '3.10']
timeout-minutes: 60
timeout-minutes: 90
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion spatialpandas/geometry/multipolygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def to_shapely(self):
shapely MultiPolygon shape
"""
import shapely.geometry as sg
polygon_arrays = np.asarray(self.data.as_py(), dtype=object)
polygon_arrays = self.data.as_py()

polygons = []
for polygon_array in polygon_arrays:
Expand Down
2 changes: 1 addition & 1 deletion spatialpandas/geometry/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def to_shapely(self):
"""
import shapely.geometry as sg
ring_arrays = [np.asarray(line_coords).reshape(len(line_coords) // 2, 2)
for line_coords in np.asarray(self.data.as_py(), dtype=object)]
for line_coords in self.data.as_py()]
rings = [sg.LinearRing(ring_array) for ring_array in ring_arrays]
return sg.Polygon(shell=rings[0], holes=rings[1:])

Expand Down

0 comments on commit b3d7ba1

Please sign in to comment.