Copilot commented on code in PR #2701:
URL: https://github.com/apache/sedona/pull/2701#discussion_r2910100665
##########
python/tests/geopandas/test_geoseries.py:
##########
@@ -1318,7 +1318,30 @@ def test_set_precision(self):
pass
def test_representative_point(self):
- pass
+ s = GeoSeries(
+ [
+ Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]),
+ LineString([(0, 0), (1, 1), (1, 0)]),
+ Point(0, 0),
+ None,
+ ]
+ )
+ result = s.representative_point()
+ # representative_point returns a point guaranteed to be within the
geometry
+ # We check that each resulting point is within (or on) the original
geometry
+ for i in range(len(result)):
+ if result.iloc[i] is None:
+ assert s.iloc[i] is None
+ else:
+ assert result.iloc[i].geom_type == "Point"
+
Review Comment:
In this test, the comments say we verify the representative point is
within/on the original geometry, but the assertions only check the output
geom_type is "Point". This also doesn’t match the PR description claiming an
expected-value check in test_geoseries.py. Consider asserting the result
matches `gpd.GeoSeries(...).representative_point()` (like other tests in this
file) and/or explicitly checking `s.iloc[i].covers(result.iloc[i])` for
non-null, non-empty geometries so the test enforces the documented contract.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]