From ec1e41443027da3201b5a61ecf66cf3e0b46a2df Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Thu, 2 Jul 2026 11:45:50 -0400 Subject: [PATCH 1/2] style(convolution): drop unused not_implemented_func import, fix isort ordering Cat 3 (F401): remove unused not_implemented_func imported from xrspatial.utils (refactor leftover, not re-exported). Cat 4 (isort): merge the two split 'from xrspatial.utils import' lines into a single alphabetised block. No behavioural change; flake8 + isort clean, 6 convolution tests pass. Includes sweep-style-state.csv update for convolution. --- .claude/sweep-style-state.csv | 1 + xrspatial/convolution.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.claude/sweep-style-state.csv b/.claude/sweep-style-state.csv index b84f4b020..f4c6cdd76 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -2,6 +2,7 @@ module,last_inspected,issue,severity_max,categories_found,notes aspect,2026-06-21,3437,MEDIUM,4,flake8 clean; isort drift (geodesic wrap + duplicate utils import line); Cat1/2/3/5 none; fixed via PR for issue 3437 classify,2026-06-20,3402,HIGH,3;4,"F401 unused not_implemented_func import; isort ordering (cmath group, dataset_support before utils). No Cat 1/2/5. Fixed in rockout PR." 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." +convolution,2026-07-02,,HIGH,3;4,"Cat 3 F401: unused not_implemented_func imported from xrspatial.utils (refactor leftover, not re-exported; convolution exports calc_cellsize/circle_kernel/annulus_kernel/custom_kernel/convolve_2d/convolution_2d). Cat 4 isort: two split 'from xrspatial.utils import' lines merged into one sorted block, _dask_task_name_kwargs alphabetised in. No Cat 1/2/5 (grep clean: no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 6 convolution tests pass (CUDA available). Fix on deep-sweep branch + PR." cost_distance,2026-06-15,3339,HIGH,1;3;4;5,"Cat 3 F401: removed unused 'from functools import partial' (L32, refactor leftover, not re-exported). Cat 5 mutable default target_values: list = [] was found here too, but the parallel api-consistency PR #3348 fixed it first (same None-sentinel normalization, merged to main); on reconciliation this PR's duplicate source change and its two target_values tests were dropped, so PR #3350 is now lint-only. Cat 1: E302 L63 (1->2 blank lines before @ngjit _heap_push; placed blanks between comment divider and decorator to satisfy both E302 and isort) + E127 x5 (_cost_distance_dask_cupy L461-462, _cost_distance_dask_iterative L1005-1007 signature continuation over-indent). Cat 4 isort: dataset_support before utils, utils from-import reflowed to 100 cols. Cat 2 grep clean. flake8+isort clean on module after fix; cost_distance tests pass (CUDA available). Pre-existing test-file lint (F401 L314/L504, E201 L449, isort drift) left untouched - out of module scope. PR open." dasymetric,2026-06-20,3411,HIGH,1;3;4,"F401 is_dask_cupy unused (HIGH); E128 line 323 continuation indent (MED); isort utils import block (MED). Fixed + flake8/isort clean, 61 tests pass. PR #3411. Issue-create was denied by auto-mode classifier (judged LOW); PR went through." diffusion,2026-06-20,3421,HIGH,3;4,F401 unused not_implemented_func (HIGH); isort import-ordering drift (MEDIUM); no Cat1/2/5. Fixed in PR off issue 3421. diff --git a/xrspatial/convolution.py b/xrspatial/convolution.py index b1b08bfb7..ef1edd5c8 100644 --- a/xrspatial/convolution.py +++ b/xrspatial/convolution.py @@ -5,10 +5,9 @@ import xarray as xr from numba import cuda, jit, prange -from xrspatial.utils import (ArrayTypeFunctionMapping, _boundary_to_dask, _pad_array, - _validate_boundary, _validate_raster, cuda_args, - get_dataarray_resolution, not_implemented_func) -from xrspatial.utils import _dask_task_name_kwargs +from xrspatial.utils import (ArrayTypeFunctionMapping, _boundary_to_dask, _dask_task_name_kwargs, + _pad_array, _validate_boundary, _validate_raster, cuda_args, + get_dataarray_resolution) # 3rd-party try: From 0073d26377ec2f3b28016dc51c76da67bdcab573 Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Thu, 2 Jul 2026 11:46:38 -0400 Subject: [PATCH 2/2] state(style): record PR #3613 for convolution --- .claude/sweep-style-state.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/sweep-style-state.csv b/.claude/sweep-style-state.csv index f4c6cdd76..f71bbfdcb 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -2,7 +2,7 @@ module,last_inspected,issue,severity_max,categories_found,notes aspect,2026-06-21,3437,MEDIUM,4,flake8 clean; isort drift (geodesic wrap + duplicate utils import line); Cat1/2/3/5 none; fixed via PR for issue 3437 classify,2026-06-20,3402,HIGH,3;4,"F401 unused not_implemented_func import; isort ordering (cmath group, dataset_support before utils). No Cat 1/2/5. Fixed in rockout PR." 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." -convolution,2026-07-02,,HIGH,3;4,"Cat 3 F401: unused not_implemented_func imported from xrspatial.utils (refactor leftover, not re-exported; convolution exports calc_cellsize/circle_kernel/annulus_kernel/custom_kernel/convolve_2d/convolution_2d). Cat 4 isort: two split 'from xrspatial.utils import' lines merged into one sorted block, _dask_task_name_kwargs alphabetised in. No Cat 1/2/5 (grep clean: no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 6 convolution tests pass (CUDA available). Fix on deep-sweep branch + PR." +convolution,2026-07-02,,HIGH,3;4,"Cat 3 F401: unused not_implemented_func imported from xrspatial.utils (refactor leftover, not re-exported; convolution exports calc_cellsize/circle_kernel/annulus_kernel/custom_kernel/convolve_2d/convolution_2d). Cat 4 isort: two split 'from xrspatial.utils import' lines merged into one sorted block, _dask_task_name_kwargs alphabetised in. No Cat 1/2/5 (grep clean: no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 6 convolution tests pass (CUDA available). Fix on deep-sweep branch; PR #3613." cost_distance,2026-06-15,3339,HIGH,1;3;4;5,"Cat 3 F401: removed unused 'from functools import partial' (L32, refactor leftover, not re-exported). Cat 5 mutable default target_values: list = [] was found here too, but the parallel api-consistency PR #3348 fixed it first (same None-sentinel normalization, merged to main); on reconciliation this PR's duplicate source change and its two target_values tests were dropped, so PR #3350 is now lint-only. Cat 1: E302 L63 (1->2 blank lines before @ngjit _heap_push; placed blanks between comment divider and decorator to satisfy both E302 and isort) + E127 x5 (_cost_distance_dask_cupy L461-462, _cost_distance_dask_iterative L1005-1007 signature continuation over-indent). Cat 4 isort: dataset_support before utils, utils from-import reflowed to 100 cols. Cat 2 grep clean. flake8+isort clean on module after fix; cost_distance tests pass (CUDA available). Pre-existing test-file lint (F401 L314/L504, E201 L449, isort drift) left untouched - out of module scope. PR open." dasymetric,2026-06-20,3411,HIGH,1;3;4,"F401 is_dask_cupy unused (HIGH); E128 line 323 continuation indent (MED); isort utils import block (MED). Fixed + flake8/isort clean, 61 tests pass. PR #3411. Issue-create was denied by auto-mode classifier (judged LOW); PR went through." diffusion,2026-06-20,3421,HIGH,3;4,F401 unused not_implemented_func (HIGH); isort import-ordering drift (MEDIUM); no Cat1/2/5. Fixed in PR off issue 3421.