diff --git a/.claude/sweep-style-state.csv b/.claude/sweep-style-state.csv index 85f82e45d..68a825e93 100644 --- a/.claude/sweep-style-state.csv +++ b/.claude/sweep-style-state.csv @@ -17,6 +17,7 @@ mahalanobis,2026-06-30,,HIGH,3;4,F401 unused is_dask_cupy import (Cat 3 HIGH) + 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 +pathfinding,2026-07-08,3650,HIGH,3;4;5,"flake8 baseline 1: F401 has_dask_array imported from xrspatial.utils but unused (refactor leftover, not re-exported anywhere; HIGH per Cat 3). Cat 4 isort drift: dask/dask.array order in try block, _heap_push/_heap_pop order, hand-wrapped utils block, missing blank line after function-local import cupy. Cat 5: mutable default barriers: list = [] on both public funcs, never mutated (rebound via np.asarray) -- duplicate of #3644 item 4 (api-consistency sweep, same day), excluded from this fix. Cat 1/2 clean. Fixed F401+isort via issue #3650." perlin,2026-06-23,,HIGH,3;4,"Cat3 F401: unused not_implemented_func import from xrspatial.utils (refactor leftover, not re-exported; __init__ exports only perlin). Cat4 isort: utils from-import reflowed to line_length=100 after the name was dropped. No Cat1/2/5 (grep clean: no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; import smoke test ok; 12 perlin tests pass (CUDA available). GitHub issues disabled on repo so no issue filed; fix on deep-sweep branch + PR." polygon_clip,2026-06-10,3184,HIGH,3;4,"Cat 3 F401: dropped unused typing imports Sequence/Tuple/Union (line 10, only Optional used) and the dead 'import cupy' inside the _apply_mask dask+cupy closure (line 245); the other 'import cupy' at line 261 is used (cupy.asarray) and kept. None re-exported (__init__ re-exports only clip_polygon). Cat 4 isort: reflowed the 5-name xrspatial.utils from-import block to line_length=100. Cat 1/2/5 grep clean (no E/W codes, no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 23 test_polygon_clip tests pass. PR open." 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." diff --git a/xrspatial/pathfinding.py b/xrspatial/pathfinding.py index 3c1a4199c..a5d3c228b 100644 --- a/xrspatial/pathfinding.py +++ b/xrspatial/pathfinding.py @@ -8,19 +8,16 @@ import xarray as xr try: - import dask.array as da import dask + import dask.array as da except ImportError: da = None dask = None -from xrspatial.cost_distance import _heap_push, _heap_pop +from xrspatial.cost_distance import _heap_pop, _heap_push from xrspatial.dataset_support import supports_dataset -from xrspatial.utils import ( - _validate_raster, - get_dataarray_resolution, ngjit, - has_cuda_and_cupy, is_cupy_array, is_dask_cupy, has_dask_array, -) +from xrspatial.utils import (_validate_raster, get_dataarray_resolution, has_cuda_and_cupy, + is_cupy_array, is_dask_cupy, ngjit) NONE = -1 @@ -1060,6 +1057,7 @@ def a_star_search(surface: xr.DataArray, elif _is_cupy_backend: import cupy + # Transfer to CPU, run numpy kernel, transfer back if 'surface_np' not in dir(): surface_np = surface_data.get()