Skip to content

Commit

Permalink
Update flake8 to 7.1.1. (#1458)
Browse files Browse the repository at this point in the history
We need to update flake8 to fix a false-positive that appears with older flake8 versions on Python 3.12.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - James Lamb (https://github.com/jameslamb)

URL: #1458
  • Loading branch information
bdice authored Sep 20, 2024
1 parent a2d21c9 commit 43776f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
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

0 comments on commit 43776f2

Please sign in to comment.