Bug#1025613: python-geopandas: Test failures with Shapely 2.0
Bas Couwenberg
sebastic at xs4all.nl
Tue Dec 6 16:04:54 GMT 2022
Source: python-geopandas
Version: 0.12.1-2
Severity: important
Tags: upstream
User: debian-gis at lists.debian.org
Usertags: shapely-2.0
Control: forwarded -1 https://github.com/geopandas/geopandas/issues/2664
Dear Maintainer,
Your package has test failures with Shapely 2.0:
_ ERROR at setup of TestClipWithSingleRectangleGdf.test_mixed_geom[single_rectangle_gdf] _
@pytest.fixture
def mixed_gdf():
"""Create a Mixed Polygon and LineString For Testing"""
> point = Point([(2, 3), (11, 4), (7, 2), (8, 9), (1, 13)])
geopandas/tools/tests/test_clip.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <class 'shapely.geometry.point.Point'>
args = ([(2, 3), (11, 4), (7, 2), (8, 9), (1, 13)],)
coords = array([[ 2, 3],
[11, 4],
[ 7, 2],
[ 8, 9],
[ 1, 13]])
geom = array([<POINT (2 3)>, <POINT (11 4)>, <POINT (7 2)>, <POINT (8 9)>,
<POINT (1 13)>], dtype=object)
def __new__(self, *args):
if len(args) == 0:
# empty geometry
# TODO better constructor
return shapely.from_wkt("POINT EMPTY")
elif len(args) > 3:
raise TypeError(f"Point() takes at most 3 arguments ({len(args)} given)")
elif len(args) == 1:
coords = args[0]
if isinstance(coords, Point):
return coords
# Accept either (x, y) or [(x, y)]
if not hasattr(coords, "__getitem__"): # generators
coords = list(coords)
coords = np.asarray(coords).squeeze()
else:
# 2 or 3 args
coords = np.array(args).squeeze()
geom = shapely.points(coords)
if not isinstance(geom, Point):
> raise ValueError("Invalid values passed to Point constructor")
E ValueError: Invalid values passed to Point constructor
/usr/lib/python3/dist-packages/shapely/geometry/point.py:75: ValueError
The build does not fail because test failures are ignored.
Kind Regards,
Bas
More information about the Pkg-grass-devel
mailing list