Skip to content

Commit

Permalink
xfail Python tests dependent on invalid Polygons (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored Oct 7, 2024
1 parent d4835ee commit cc8fd60
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python/cuspatial/cuspatial/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def gs():
g8 = Polygon(
((35, 36), (37, 38), (39, 40), (41, 42)),
)
# TODO: g9, g10, g11 are invalid
# https://github.com/libgeos/geos/issues/1177
g9 = MultiPolygon(
[
(
Expand Down
11 changes: 10 additions & 1 deletion python/cuspatial/cuspatial/tests/test_cudf_integration.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Copyright (c) 2022 NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
import geopandas as gpd
import numpy as np
import pandas as pd
import pytest

import cuspatial

reason = (
"gs fixture contains invalid Polygons/MultiPolygons: "
"https://github.com/libgeos/geos/issues/1177"
)


@pytest.mark.xfail(reason=reason)
def test_sort_index_series(gs):
gs.index = np.random.permutation(len(gs))
cugs = cuspatial.from_geopandas(gs)
Expand All @@ -14,6 +21,7 @@ def test_sort_index_series(gs):
gpd.testing.assert_geoseries_equal(got, expected)


@pytest.mark.xfail(reason=reason)
def test_sort_index_dataframe(gpdf):
gpdf.index = np.random.permutation(len(gpdf))
cugpdf = cuspatial.from_geopandas(gpdf)
Expand All @@ -22,6 +30,7 @@ def test_sort_index_dataframe(gpdf):
gpd.testing.assert_geodataframe_equal(got, expected)


@pytest.mark.xfail(reason=reason)
def test_sort_values(gpdf):
cugpdf = cuspatial.from_geopandas(gpdf)
expected = gpdf.sort_values("random")
Expand Down
8 changes: 7 additions & 1 deletion python/cuspatial/cuspatial/tests/test_geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,13 @@ def test_cudf_dataframe_init():
assert_eq_geo_df(gdf.to_pandas(), gpd.GeoDataFrame(df.to_pandas()))


def test_apply_boolean_mask(gpdf, mask_factory):
def test_apply_boolean_mask(gpdf, mask_factory, request):
if "MaskNone" not in request.node.callspec.id:
reason = (
"gs fixture contains invalid Polygons/MultiPolygons: "
"https://github.com/libgeos/geos/issues/1177"
)
request.applymarker(pytest.mark.xfail(reason=reason))
mask = mask_factory(len(gpdf))

expected = gpdf[mask]
Expand Down

0 comments on commit cc8fd60

Please sign in to comment.