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

Forward-merge branch-24.10 into branch-24.12 #1460

Merged
merged 1 commit into from
Sep 20, 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: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
# Explicitly specify the pyproject.toml at the repo root, not per-project.
args: ["--config", "pyproject.toml"]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 7.1.1
hooks:
- id: flake8
args: ["--config=.flake8"]
Expand Down
11 changes: 5 additions & 6 deletions python/cuspatial/cuspatial/tests/test_geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def generator(size, has_z=False):


def assert_eq_point(p1, p2):
assert type(p1) == type(p2)
assert type(p1) is type(p2)
assert p1.x == p2.x
assert p1.y == p2.y
assert p1.has_z == p2.has_z
Expand All @@ -76,7 +76,7 @@ def assert_eq_point(p1, p2):


def assert_eq_multipoint(p1, p2):
assert type(p1) == type(p2)
assert type(p1) is type(p2)
assert len(p1) == len(p2)
for i in range(len(p1)):
assert_eq_point(p1[i], p2[i])
Expand All @@ -93,8 +93,7 @@ def assert_eq_multipolygon(p1, p2):


def assert_eq_geo_df(geo1, geo2):
if type(geo1) != type(geo2):
assert TypeError
assert type(geo1) is type(geo2)
assert geo1.columns.equals(geo2.columns)
for col in geo1.columns:
if geo1[col].dtype == "geometry":
Expand All @@ -112,7 +111,7 @@ def test_select_multiple_columns(gpdf):

def test_type_persistence(gpdf):
cugpdf = cuspatial.from_geopandas(gpdf)
assert type(cugpdf["geometry"]) == cuspatial.GeoSeries
assert type(cugpdf["geometry"]) is cuspatial.GeoSeries


def test_interleaved_point(gpdf, polys):
Expand Down Expand Up @@ -462,7 +461,7 @@ def test_reset_index(level, drop, inplace, col_level, col_fill):
def test_cudf_dataframe_init():
df = cudf.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
gdf = cuspatial.GeoDataFrame(df)
assert_eq_geo_df(gdf.to_pandas(), df.to_pandas())
assert_eq_geo_df(gdf.to_pandas(), gpd.GeoDataFrame(df.to_pandas()))


def test_apply_boolean_mask(gpdf, mask_factory):
Expand Down
10 changes: 5 additions & 5 deletions python/cuspatial/cuspatial/tests/test_geoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def generator(size: Integral, obj_type: Example_Feature_Enum = None):


def assert_eq_point(p1, p2):
assert type(p1) == type(p2)
assert type(p1) is type(p2)
assert p1.x == p2.x
assert p1.y == p2.y
assert p1.has_z == p2.has_z
Expand All @@ -97,14 +97,14 @@ def assert_eq_point(p1, p2):


def assert_eq_multipoint(p1, p2):
assert type(p1) == type(p2)
assert type(p1) is type(p2)
assert len(p1) == len(p2)
for i in range(len(p1)):
assert_eq_point(p1[i], p2[i])


def assert_eq_linestring(p1, p2):
assert type(p1) == type(p2)
assert type(p1) is type(p2)
assert p1 == p2


Expand All @@ -124,8 +124,8 @@ def assert_eq_multipolygon(p1, p2):


def assert_eq_geo(geo1, geo2):
if type(geo1) != type(geo2):
assert TypeError
if type(geo1) is not type(geo2):
raise TypeError
result = geo1.equals(geo2)
if isinstance(result, bool):
assert result
Expand Down
Loading