From ccb9841b2207b9f3e5f4591d281ba78c006d81e5 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Thu, 17 Oct 2024 01:44:43 +0000 Subject: [PATCH] DRY up another test --- python/cuspatial/cuspatial/tests/test_geoseries.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/python/cuspatial/cuspatial/tests/test_geoseries.py b/python/cuspatial/cuspatial/tests/test_geoseries.py index 27c8ab4df..5304d7ea6 100644 --- a/python/cuspatial/cuspatial/tests/test_geoseries.py +++ b/python/cuspatial/cuspatial/tests/test_geoseries.py @@ -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 @@ -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, @@ -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),