Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/sweep-style-state.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ convolution,2026-07-02,,HIGH,3;4,"Cat 3 F401: unused not_implemented_func import
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.
edge_detection,2026-07-18,3675,MEDIUM,1;4,"flake8 baseline 4: E201 x4 on SOBEL_Y/PREWITT_Y kernel literals (leading space aligned columns under the -1 rows); dropped the space to match LAPLACIAN_KERNEL style in the same file, kernels numerically unchanged. Module isort clean. Test file fixed in same PR: E302 before first fixture + isort import-block reflow to line_length=100. Cat 2/3/5 clean (grep: no bare except, mutable defaults, ==None/True, or shadowed builtins). flake8+isort clean after fix; 87 edge_detection tests pass (CUDA available). Issue #3675."
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.
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."
geotiff,2026-07-02,,,,"Re-sweep 2026-07-02 (deep-sweep). flake8 baseline 0 and isort clean across all 29 source files (setup.cfg max-line-length=100, isort line_length=100). Cat 1/2/3/4 all clean. Cat 5 grep clean: no bare except, no mutable defaults, no ==None/True/False in code; shadow-grep hits are type annotations (seen: list, attrs: dict), the getaddrinfo type= kwarg in _sources.py, and QML/XML template strings in _symbology.py - all false positives. Prior #3537 isort drift already fixed (see 2026-07-01 row / #3588). No findings; no /rockout."
Expand Down
8 changes: 4 additions & 4 deletions xrspatial/edge_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
[-1, 0, 1]], dtype=np.float64)

SOBEL_Y = np.array([[-1, -2, -1],
[ 0, 0, 0],
[ 1, 2, 1]], dtype=np.float64)
[0, 0, 0],
[1, 2, 1]], dtype=np.float64)

# -- Prewitt kernels ---------------------------------------------------------
PREWITT_X = np.array([[-1, 0, 1],
[-1, 0, 1],
[-1, 0, 1]], dtype=np.float64)

PREWITT_Y = np.array([[-1, -1, -1],
[ 0, 0, 0],
[ 1, 1, 1]], dtype=np.float64)
[0, 0, 0],
[1, 1, 1]], dtype=np.float64)

# -- Laplacian kernel --------------------------------------------------------
LAPLACIAN_KERNEL = np.array([[0, 1, 0],
Expand Down
19 changes: 7 additions & 12 deletions xrspatial/tests/test_edge_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,18 @@
import pytest
import xarray as xr

from xrspatial.edge_detection import (
LAPLACIAN_KERNEL, PREWITT_X, PREWITT_Y, SOBEL_X, SOBEL_Y,
laplacian, prewitt_x, prewitt_y, sobel_x, sobel_y,
)
from xrspatial.tests.general_checks import (
assert_boundary_mode_correctness,
assert_numpy_equals_dask_numpy,
create_test_raster,
cuda_and_cupy_available,
dask_array_available,
general_output_checks,
)
from xrspatial.edge_detection import (LAPLACIAN_KERNEL, PREWITT_X, PREWITT_Y, SOBEL_X, SOBEL_Y,
laplacian, prewitt_x, prewitt_y, sobel_x, sobel_y)
from xrspatial.tests.general_checks import (assert_boundary_mode_correctness,
assert_numpy_equals_dask_numpy, create_test_raster,
cuda_and_cupy_available, dask_array_available,
general_output_checks)

# ---------------------------------------------------------------------------
# Fixtures
# ---------------------------------------------------------------------------


@pytest.fixture
def ramp_data():
"""5x6 ramp: values increase left-to-right, constant top-to-bottom."""
Expand Down
Loading