Skip to content

Commit b3d7ba1

Browse files
authored
Don't use dtype=object when converting arrays to pass to shapely 2 (#103)
* 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
1 parent 26cfd93 commit b3d7ba1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
2121
python-version: [3.7, 3.8, 3.9, '3.10']
22-
timeout-minutes: 60
22+
timeout-minutes: 90
2323
defaults:
2424
run:
2525
shell: bash -l {0}

spatialpandas/geometry/multipolygon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def to_shapely(self):
5959
shapely MultiPolygon shape
6060
"""
6161
import shapely.geometry as sg
62-
polygon_arrays = np.asarray(self.data.as_py(), dtype=object)
62+
polygon_arrays = self.data.as_py()
6363

6464
polygons = []
6565
for polygon_array in polygon_arrays:

spatialpandas/geometry/polygon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def to_shapely(self):
6161
"""
6262
import shapely.geometry as sg
6363
ring_arrays = [np.asarray(line_coords).reshape(len(line_coords) // 2, 2)
64-
for line_coords in np.asarray(self.data.as_py(), dtype=object)]
64+
for line_coords in self.data.as_py()]
6565
rings = [sg.LinearRing(ring_array) for ring_array in ring_arrays]
6666
return sg.Polygon(shell=rings[0], holes=rings[1:])
6767

0 commit comments

Comments
 (0)