Skip to content

Commit 68451f7

Browse files
committed
Style: clean up dasymetric.py lint (F401, E128, isort)
Remove unused is_dask_cupy import (F401), fix E128 continuation indent in the dask+cupy disaggregate path, and reformat the xrspatial.utils import block to isort's line_length=100 form. No behavior change; all 61 tests in test_dasymetric.py pass and flake8 + isort are clean. Found by the /deep-sweep style sweep.
1 parent 5f0e4b8 commit 68451f7

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

.claude/sweep-style-state.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module,last_inspected,issue,severity_max,categories_found,notes
22
aspect,2026-05-29,2683,MEDIUM,1,E402+E305 line 38: from xrspatial.geodesic import block sat below _geodesic_cuda_dims; moved up with top-of-file imports. E501 lines 219/263: wrapped two _run_gpu_geodesic_aspect kernel-launch calls (101/109 chars). Cat 4 isort reviewed but NOT applied: slope.py/curvature.py use one-import-per-line for xrspatial.utils so raw isort would make aspect inconsistent. Cat 2/3/5 grep clean. PR #2740. 82 aspect+geodesic tests pass.
33
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."
44
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."
5+
dasymetric,2026-06-20,,HIGH,1;3;4,"F401 is_dask_cupy unused (HIGH); E128 line 323 continuation indent (MED); isort utils import block (MED). Fixed locally + verified flake8/isort clean, 61 tests pass. Issue/PR external writes denied by auto-mode classifier; awaiting user to file issue + push PR."
56
fire,2026-06-19,3395,HIGH,3;4,Cat3 F401 math.log unused + F841 S_T unused local; Cat4 isort utils import reorder. No Cat1/2/5. Fixed in #3395 rockout.
67
focal,2026-05-29,2731,HIGH,3;4;5,"F401 not_implemented_func (import line 36, unused, not re-exported). isort: stdlib reorder (import math before from-imports), dropped stray blank lines in import groups, alphabetised+rewrapped convolution/utils from-imports, moved dataset_support import into order. Cat 5: mutable default excludes=[np.nan] in mean() (line 238) -> None sentinel, resolved to [np.nan] in body; never mutated so behaviour preserved; regression test test_mean_default_excludes_does_not_leak added. Cat 1/2 clean. 115 focal tests pass. PR pending."
78
geotiff,2026-06-14,3329,MEDIUM,4,"Re-sweep after #3259: flake8 baseline 0 across all 33 production files (flake8 7.3.0). Cat 4 only: isort (line_length=100) drift in _writers/eager.py (the from .._validation import block wrapped at ~80 cols, not 100); rewrapped, no behavioural change. Cat 1/2/3/5 clean: no E/W/F codes; grep hits for == False (comment), ': dict'/': list' annotations, and type=getaddrinfo kwarg are all false positives, not shadowed builtins or comparisons. isort+flake8 clean after fix; import smoke test ok. PR via #3329."

xrspatial/dasymetric.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,8 @@
5050
class cupy:
5151
ndarray = False
5252

53-
from xrspatial.utils import (
54-
ArrayTypeFunctionMapping,
55-
_dask_task_name_kwargs,
56-
has_cuda_and_cupy,
57-
has_dask_array,
58-
is_cupy_array,
59-
is_dask_cupy,
60-
)
53+
from xrspatial.utils import (ArrayTypeFunctionMapping, _dask_task_name_kwargs, has_cuda_and_cupy,
54+
has_dask_array, is_cupy_array)
6155

6256
VALID_METHODS = ('binary', 'weighted', 'limiting_variable')
6357

@@ -320,7 +314,7 @@ def _disaggregate_dask_cupy(zones_da, weight_da, values_dict, method,
320314
dtype=weight_da.dtype,
321315
meta=np.array((), dtype=weight_da.dtype))
322316
return _disaggregate_dask_numpy(zones_np, weight_np, values_dict,
323-
method, nodata_zone)
317+
method, nodata_zone)
324318

325319

326320
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)