Skip to content

Commit 7e8962d

Browse files
authored
classify: remove unused import and fix isort ordering (#3405)
* classify: remove unused import and fix isort ordering Remove the unused not_implemented_func import (flake8 F401) and reorder the import block so isort passes under the setup.cfg config (cmath into the stdlib group, dataset_support before utils). No behavioural change. * sweep-style: record classify inspection (issue #3402)
1 parent 6239de8 commit 7e8962d

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

.claude/sweep-style-state.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
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.
3+
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."
34
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."
45
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."
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.

xrspatial/classify.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import annotations
22

3+
import cmath
34
import warnings
45
from functools import partial
56
from typing import List, Optional
67

7-
import cmath
8-
98
import xarray as xr
109

1110
try:
@@ -24,16 +23,9 @@ class cupy(object):
2423
import numba as nb
2524
import numpy as np
2625

27-
from xrspatial.utils import (
28-
ArrayTypeFunctionMapping,
29-
_dask_task_name_kwargs,
30-
_validate_raster,
31-
_validate_scalar,
32-
cuda_args,
33-
ngjit,
34-
not_implemented_func,
35-
)
3626
from xrspatial.dataset_support import supports_dataset
27+
from xrspatial.utils import (ArrayTypeFunctionMapping, _dask_task_name_kwargs, _validate_raster,
28+
_validate_scalar, cuda_args, ngjit)
3729

3830

3931
def _available_memory_bytes():

0 commit comments

Comments
 (0)