Skip to content

polygonize: fix flake8 F401, E127, and isort drift#2535

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-style-polygonize-2026-05-27
May 28, 2026
Merged

polygonize: fix flake8 F401, E127, and isort drift#2535
brendancol merged 1 commit into
mainfrom
deep-sweep-style-polygonize-2026-05-27

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #2534.

Summary

  • Drop the unused is_cupy_array import from .utils (F401). The symbol is not referenced anywhere in polygonize.py and the module has no __all__, so it was never re-exported either.
  • Collapse the now-3-symbol .utils import to a single line. At 78 chars it fits within the configured 100-char line_length, so isort prefers the single-line form — same edit closes the isort diff.
  • Pull the second argument of the two overload(...) calls in generated_jit back four columns so the continuation aligns with the opening paren (E127).

Categories addressed

  • Cat 1 (E127): 2 occurrences
  • Cat 3 (F401): 1 occurrence
  • Cat 4 (isort): import block reflow

No Cat 2 findings. Cat 5 grep clean (no bare except, no mutable default args, no shadowed builtins).

Backend coverage

Style-only. No behavioural change. The fixes apply uniformly across the numpy / cupy / dask backends dispatched via ArrayTypeFunctionMapping.

Test plan

  • flake8 xrspatial/polygonize.py is silent
  • isort --check-only --diff xrspatial/polygonize.py is silent
  • pytest xrspatial/tests/test_polygonize*.py -- 237 passed, 13 skipped

Closes #2534.

- Drop unused `is_cupy_array` import from `.utils` (F401). The symbol
  is not referenced anywhere in `polygonize.py` and is not re-exported
  (module has no `__all__`).
- Collapse the now-3-symbol `.utils` import to a single line — within
  the configured 100-char `line_length`, isort prefers the single-line
  form, so this also clears the isort diff.
- Pull the second argument of the two `overload(...)` calls in
  `generated_jit` back four columns so the continuation aligns with the
  opening paren (E127). Style-only.

Categories addressed:
- Cat 1 (E127): 2 occurrences
- Cat 3 (F401): 1 occurrence
- Cat 4 (isort): import block reflow

Cat 2 clean. Cat 5 grep clean (no bare except, no mutable defaults,
no shadowed builtins).

No behavioural change. Style-only, applies uniformly across the
numpy/cupy/dask backends dispatched via `ArrayTypeFunctionMapping`.

Test plan:
- flake8 xrspatial/polygonize.py is silent
- isort --check-only --diff xrspatial/polygonize.py is silent
- pytest xrspatial/tests/test_polygonize*.py -- 237 passed, 13 skipped
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 27, 2026
@brendancol
Copy link
Copy Markdown
Contributor Author

Review pass on the head of this branch — nothing to address.

Scope check:

  • Diff is 3 lines changed in xrspatial/polygonize.py plus a one-line CSV bookkeeping entry. Pure style sweep, no behavioural delta.

Verified:

  • is_cupy_array is not referenced in polygonize.py and the module has no __all__, so the F401 drop is safe. xrspatial/__init__.py and accessor.py only re-export polygonize from this module.
  • The collapsed .utils import is 78 chars, well inside the 100-char line_length, matching isort's preferred single-line form.
  • The E127 re-indent inside generated_jit only touches whitespace on the strict=False continuation of the two overload(...) calls. No semantic change.

Local checks on this branch:

  • flake8 xrspatial/polygonize.py — silent
  • isort --check-only --diff xrspatial/polygonize.py — silent
  • pytest xrspatial/tests/test_polygonize*.py — 237 passed, 13 skipped

No blockers, suggestions, or nits. No follow-up commit needed.

@brendancol brendancol merged commit 2220ae8 into main May 28, 2026
9 checks passed
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.

polygonize: fix flake8 F401, E127, and isort drift

1 participant