From 0102cd39a5b64cb1996f52dd92b3ab810b581c7c Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Fri, 29 May 2026 16:42:42 -0700 Subject: [PATCH 1/2] Fix flake8 F821 in contour.py: guard geopandas import with TYPE_CHECKING (#2698) --- xrspatial/contour.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xrspatial/contour.py b/xrspatial/contour.py index 99e1096ff..6e38ba7fa 100644 --- a/xrspatial/contour.py +++ b/xrspatial/contour.py @@ -8,13 +8,16 @@ # The algorithm is embarrassingly parallel across quads and across contour # levels, making it well suited to Dask chunking and GPU execution. -from typing import List, Optional, Sequence, Tuple, Union +from typing import TYPE_CHECKING, List, Optional, Sequence, Tuple, Union import numpy as np import xarray as xr from .utils import ArrayTypeFunctionMapping, ngjit +if TYPE_CHECKING: + import geopandas as gpd + try: import dask import dask.array as da From 8be470d3e014356056e211b7c48032cc8a52fbb8 Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Fri, 29 May 2026 16:43:02 -0700 Subject: [PATCH 2/2] Update sweep-style state for contour (#2698) --- .claude/sweep-style-state.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/.claude/sweep-style-state.csv b/.claude/sweep-style-state.csv index 1e03170ce..8647c2679 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -1,4 +1,5 @@ module,last_inspected,issue,severity_max,categories_found,notes +contour,2026-05-29,2698,HIGH,3,"F821 line 557: contours() return annotation ""gpd.GeoDataFrame"" referenced gpd not bound at module scope (only imported inside _to_geopandas). Fixed via TYPE_CHECKING-guarded import geopandas as gpd, matching polygonize.py. No runtime change; geopandas stays optional. isort clean. Cat 1/2/4/5 clean. 24 contour tests pass. PR open." geotiff,2026-05-27,2481,HIGH,1;3;4,"Bundled 387 flake8 + ~30 isort fixes since #2285/#2430. F401 x9, F811 x6, F841 x3. E501 x250 (mostly wrapped, 3 file-scope imports keep noqa: E402+E501). E252 x62, blank-line cluster, E128/E127 indents. importorskip imports use # noqa: E402. Cat 5 grep clean." polygonize,2026-05-27,2534,HIGH,1;3;4,"F401 line 58 (is_cupy_array unused, not re-exported). E127 lines 83/88 (overload continuation indent in generated_jit). isort: 5-line .utils import block collapses to one line at 100-char limit. Cat 2 clean. Cat 5 grep clean." rasterize,2026-05-27,2503,HIGH,1;3,F401 line 15 + F811 line 1193 (paired: local import warnings shadowed unused module-level import); E306 line 1775 (nested @cuda.jit). isort clean. Cat 5 grep clean. Fix in PR #2507.