mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-09 11:22:50 +08:00
TST: update is_closed test for shapely 1.8.2 (#2437)
This commit is contained in:
@@ -28,6 +28,7 @@ PANDAS_GE_14 = Version(pd.__version__) >= Version("1.4.0rc0")
|
||||
|
||||
|
||||
SHAPELY_GE_18 = Version(shapely.__version__) >= Version("1.8")
|
||||
SHAPELY_GE_182 = Version(shapely.__version__) >= Version("1.8.2")
|
||||
SHAPELY_GE_20 = Version(shapely.__version__) >= Version("2.0")
|
||||
|
||||
GEOS_GE_390 = shapely.geos.geos_version >= (3, 9, 0)
|
||||
|
||||
@@ -467,8 +467,18 @@ def test_unary_predicates(attr):
|
||||
# empty Linearring.is_ring gives False with Shapely < 2.0
|
||||
if compat.USE_PYGEOS and not compat.SHAPELY_GE_20:
|
||||
expected[-2] = True
|
||||
elif (
|
||||
attr == "is_closed"
|
||||
and compat.USE_PYGEOS
|
||||
and compat.SHAPELY_GE_182
|
||||
and not compat.SHAPELY_GE_20
|
||||
):
|
||||
# In shapely 1.8.2, is_closed was changed to return always True for
|
||||
# Polygon/MultiPolygon, while PyGEOS returns always False
|
||||
expected = [False] * len(vals)
|
||||
else:
|
||||
expected = [getattr(t, attr) if t is not None else na_value for t in vals]
|
||||
|
||||
assert result.tolist() == expected
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user