From 98b013067ba8137f9eb999fa81e9c371eecac4ba Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Tue, 30 Jun 2026 12:09:08 -0700 Subject: [PATCH 1/2] style(mahalanobis): drop unused is_dask_cupy import, fix isort drift Cat 3 (F401): remove unused is_dask_cupy import from xrspatial.utils. Cat 4 (isort): reformat the xrspatial.utils import block to line_length=100. flake8 and isort are clean after the change; no behaviour change. dask+cupy dispatch goes through ArrayTypeFunctionMapping, not a direct is_dask_cupy check, so the removed name had no references. --- .claude/sweep-style-state.csv | 1 + xrspatial/mahalanobis.py | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.claude/sweep-style-state.csv b/.claude/sweep-style-state.csv index 1d4498afd..2534edc0b 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -11,6 +11,7 @@ geotiff,2026-06-25,,MEDIUM,4,"Re-sweep 2026-06-25 (file last modified 2026-06-24 hydro-d8,2026-05-29,2705,HIGH,1;3;4,"flake8+isort over the 13 D8 files only (dinf/mfd out of scope). Cat 3 HIGH: F401 x2 (flow_length_d8 function-local _compute_accum_seeds never called; snap_pour_point_d8 module-level cuda_args unused) - both confirmed dead, no re-export. Cat 1: E127/E128 continuation-indent x90 (mostly multi-line def signatures); E302/E303 blank-line cluster in watershed_d8; E501 x4 (flow_path_d8 + snap_pour_point_d8, wrapped ternaries). Cat 4: isort import-block reordering on all 13 files. No Cat 2 (W-codes), no Cat 5 (grep clean: no bare except, mutable defaults, ==None/==True, or shadowed builtins). flake8+isort clean after fix; 385 D8 tests pass. flow_direction_d8 needed manual blank-line placement to satisfy both isort and E302." interpolate,2026-06-12,3286,HIGH,3;4,"Full subpackage sweep (_idw, _kriging, _spline, _validation). Cat 3 F401: unused 'import math' in _idw.py L5 (IDW kernels are pure arithmetic; _spline.py keeps math for math.log in TPS kernels; not re-exported, __init__ exports only idw/kriging/spline). Cat 4 isort: _idw.py + _spline.py 5-line xrspatial.utils from-import reflowed to 2 lines under line_length=100, matching _kriging.py from #2916. Cat 1/2/5 clean (no E/W codes; grep: no bare except, mutable defaults, ==None/True, shadowed builtins). flake8+isort clean after fix; 66 interpolation tests pass (CUDA available). PR open." interpolate-kriging,2026-06-04,2916,MEDIUM,1;4,"flake8 E128 x2: continuation-line under-indent at the _chunk_var kriging-predict calls in _kriging_dask_numpy (L234) and _kriging_dask_cupy (L324); re-indented to visual-indent column. Cat 4 isort: 5-line from xrspatial.utils (...) block collapses to one 88-char line under line_length=100. Cat 2/3/5 grep clean (no W-codes, F-codes, bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 14 kriging tests pass. PR open." +mahalanobis,2026-06-30,,HIGH,3;4,F401 unused is_dask_cupy import (Cat 3 HIGH) + isort drift in xrspatial.utils block (Cat 4 MEDIUM); fixed on branch; issue/PR deferred - external GitHub writes blocked from subagent mcda,2026-06-10,3143,HIGH,3;4,F401 dead function-local warnings import in standardize.py; isort drift in weights.py combine.py __init__.py; flake8 otherwise clean; Cat 5 greps clean; fixed via PR for #3143 morphology,2026-06-20,3400,HIGH,3;4,"F401 xr/has_cuda_and_cupy/not_implemented_func + F841 size (dead); isort ordering. /rockout PR off issue 3400. flake8+isort clean, 74 tests pass." multispectral,2026-06-20,3428,HIGH,3;4,F401 unused not_implemented_func (Cat3 HIGH); isort dataset_support before utils (Cat4 MEDIUM); Cat1/2/5 clean; fixed via #3428 diff --git a/xrspatial/mahalanobis.py b/xrspatial/mahalanobis.py index 4ede6264f..b0f3380b0 100644 --- a/xrspatial/mahalanobis.py +++ b/xrspatial/mahalanobis.py @@ -13,16 +13,8 @@ import numpy as np import xarray as xr -from xrspatial.utils import ( - ArrayTypeFunctionMapping, - _dask_task_name_kwargs, - _validate_raster, - has_cuda_and_cupy, - has_dask_array, - is_cupy_array, - is_dask_cupy, - validate_arrays, -) +from xrspatial.utils import (ArrayTypeFunctionMapping, _dask_task_name_kwargs, _validate_raster, + has_cuda_and_cupy, has_dask_array, is_cupy_array, validate_arrays) try: import dask From f6be03bc46aa4bbf806ac90e58a33485fd0b02e9 Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Tue, 30 Jun 2026 12:09:50 -0700 Subject: [PATCH 2/2] state: record mahalanobis style sweep PR #3582 --- .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 2534edc0b..6e60a36bc 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -11,7 +11,7 @@ geotiff,2026-06-25,,MEDIUM,4,"Re-sweep 2026-06-25 (file last modified 2026-06-24 hydro-d8,2026-05-29,2705,HIGH,1;3;4,"flake8+isort over the 13 D8 files only (dinf/mfd out of scope). Cat 3 HIGH: F401 x2 (flow_length_d8 function-local _compute_accum_seeds never called; snap_pour_point_d8 module-level cuda_args unused) - both confirmed dead, no re-export. Cat 1: E127/E128 continuation-indent x90 (mostly multi-line def signatures); E302/E303 blank-line cluster in watershed_d8; E501 x4 (flow_path_d8 + snap_pour_point_d8, wrapped ternaries). Cat 4: isort import-block reordering on all 13 files. No Cat 2 (W-codes), no Cat 5 (grep clean: no bare except, mutable defaults, ==None/==True, or shadowed builtins). flake8+isort clean after fix; 385 D8 tests pass. flow_direction_d8 needed manual blank-line placement to satisfy both isort and E302." interpolate,2026-06-12,3286,HIGH,3;4,"Full subpackage sweep (_idw, _kriging, _spline, _validation). Cat 3 F401: unused 'import math' in _idw.py L5 (IDW kernels are pure arithmetic; _spline.py keeps math for math.log in TPS kernels; not re-exported, __init__ exports only idw/kriging/spline). Cat 4 isort: _idw.py + _spline.py 5-line xrspatial.utils from-import reflowed to 2 lines under line_length=100, matching _kriging.py from #2916. Cat 1/2/5 clean (no E/W codes; grep: no bare except, mutable defaults, ==None/True, shadowed builtins). flake8+isort clean after fix; 66 interpolation tests pass (CUDA available). PR open." interpolate-kriging,2026-06-04,2916,MEDIUM,1;4,"flake8 E128 x2: continuation-line under-indent at the _chunk_var kriging-predict calls in _kriging_dask_numpy (L234) and _kriging_dask_cupy (L324); re-indented to visual-indent column. Cat 4 isort: 5-line from xrspatial.utils (...) block collapses to one 88-char line under line_length=100. Cat 2/3/5 grep clean (no W-codes, F-codes, bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 14 kriging tests pass. PR open." -mahalanobis,2026-06-30,,HIGH,3;4,F401 unused is_dask_cupy import (Cat 3 HIGH) + isort drift in xrspatial.utils block (Cat 4 MEDIUM); fixed on branch; issue/PR deferred - external GitHub writes blocked from subagent +mahalanobis,2026-06-30,,HIGH,3;4,F401 unused is_dask_cupy import (Cat 3 HIGH) + isort drift in xrspatial.utils block (Cat 4 MEDIUM); fixed in PR #3582; issue filing blocked by auto-mode external-write classifier mcda,2026-06-10,3143,HIGH,3;4,F401 dead function-local warnings import in standardize.py; isort drift in weights.py combine.py __init__.py; flake8 otherwise clean; Cat 5 greps clean; fixed via PR for #3143 morphology,2026-06-20,3400,HIGH,3;4,"F401 xr/has_cuda_and_cupy/not_implemented_func + F841 size (dead); isort ordering. /rockout PR off issue 3400. flake8+isort clean, 74 tests pass." multispectral,2026-06-20,3428,HIGH,3;4,F401 unused not_implemented_func (Cat3 HIGH); isort dataset_support before utils (Cat4 MEDIUM); Cat1/2/5 clean; fixed via #3428