Skip to content

diffusion: drop unused import, fix isort ordering (#3421)#3423

Open
brendancol wants to merge 1 commit into
mainfrom
deep-sweep-style-diffusion-2026-06-20
Open

diffusion: drop unused import, fix isort ordering (#3421)#3423
brendancol wants to merge 1 commit into
mainfrom
deep-sweep-style-diffusion-2026-06-20

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3421.

Style cleanup of xrspatial/diffusion.py against the project's own setup.cfg flake8/isort config (max-line-length=100, line_length=100).

Categories addressed

  • Cat 3 (F401) — removed the unused not_implemented_func import. The symbol was never referenced in the module and is not part of any re-export (xrspatial/__init__.py exposes only diffuse), so the removal is behaviour-neutral.
  • Cat 4 (isort) — re-sorted the import block to the configured line_length=100: moved from numba import cuda, prange into the sorted third-party group and rewrapped the from xrspatial.utils import (...) block to the grid style already used in focal.py / slope.py. Dropped one stray blank line. No behaviour change.

No Cat 1/2/5 findings were present (no PEP8 E/W codes, no bare except, no mutable defaults, no == None/True/False, no shadowed builtins).

Verification

  • flake8 xrspatial/diffusion.py — clean
  • isort --check-only --diff xrspatial/diffusion.py — clean
  • pytest xrspatial/tests/test_diffusion.py — 25 passed

Both fixes are static and apply uniformly across the numpy / cupy / dask+numpy / dask+cupy backends; no per-backend verification needed. No auto-formatter (black/ruff) was run and the flake8/isort config was not widened.

State tracked in .claude/sweep-style-state.csv.

Remove the unused not_implemented_func import (flake8 F401) and re-sort
the import block to the configured isort line_length=100. The symbol was
never referenced and is not re-exported (xrspatial exposes only diffuse),
so removing it changes no behaviour.

Records the style-sweep state for diffusion in
.claude/sweep-style-state.csv.

flake8 and isort both clean; test_diffusion.py 25 passed.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diffusion.py: unused import (F401) and isort import-ordering drift

1 participant