Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfail Python tests dependent on invalid Polygons #1467

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading