Skip to content

Commit

Permalink
DRY up another test
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Oct 17, 2024
1 parent 5488ac6 commit ccb9841
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions python/cuspatial/cuspatial/tests/test_geoseries.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

from enum import Enum
from itertools import chain
from numbers import Integral

import cupy as cp
Expand All @@ -10,7 +9,6 @@
import pandas as pd
import pytest
from geopandas.testing import assert_geoseries_equal
from shapely import get_coordinates
from shapely.affinity import rotate
from shapely.geometry import (
LineString,
Expand Down Expand Up @@ -185,14 +183,7 @@ def test_interleaved_point(gs):
).reset_index(drop=True),
)

polys_list = gs[gs.apply(lambda x: isinstance(x, (MultiPolygon, Polygon)))]
polys = list(
chain(polys_list.apply(get_coordinates))
) # flatten multigeometries
coords_list = list(chain(*polys)) # flatten geometries
xy_interleaved = list(chain(*coords_list)) # flatten coordinates
x = xy_interleaved[::2]
y = xy_interleaved[1::2]
xy, x, y = geometry_to_coords(gs, (MultiPolygon, Polygon))

cudf.testing.assert_series_equal(
cugs.polygons.x.reset_index(drop=True),
Expand Down

0 comments on commit ccb9841

Please sign in to comment.