Skip to content

Fix isort import-ordering drift in bump.py#3611

Open
brendancol wants to merge 2 commits into
mainfrom
deep-sweep-style-bump-2026-07-02
Open

Fix isort import-ordering drift in bump.py#3611
brendancol wants to merge 2 commits into
mainfrom
deep-sweep-style-bump-2026-07-02

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3609

What

Run isort on xrspatial/bump.py to fix a Cat 4 import-ordering finding. The from xrspatial.utils import (...) block was laid out one name per line; the configured isort (line_length=100) wraps it as a two-line grid instead.

Categories addressed

  • Cat 4 (isort import ordering). No behavior change intended.
  • Cat 1/2/3/5 were clean, so nothing else in scope: no flake8 E/W codes (baseline 0), no unused imports or dead locals, no bare except, no mutable default args, no shadowed builtins.

Test plan

  • flake8 xrspatial/bump.py clean
  • isort --check-only xrspatial/bump.py clean
  • xrspatial/tests/test_bump.py passes (18 tests, CUDA available so cupy and dask+cupy paths ran)
  • Module imports and all five xrspatial.utils names resolve

Found by the /sweep-style deep sweep (2026-07-02).

Cat 4 (isort): collapse the vertical-hanging-indent xrspatial.utils
import block to a two-line grid wrap under line_length=100. flake8
baseline was already 0; no behavior change. Also record the bump row
in the style-sweep state CSV.

Found by /sweep-style deep sweep (2026-07-02).

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: Fix isort import-ordering drift in bump.py

This is a lint-only change. The one code edit reflows the from xrspatial.utils import (...) block from a one-name-per-line layout to the two-line grid wrap that the configured isort (line_length=100) produces. The imported names are unchanged (ArrayTypeFunctionMapping, _validate_scalar, has_cuda_and_cupy, is_cupy_array, ngjit), so there is no runtime effect. The other diff hunk is the style-sweep state CSV row.

Blockers (must fix before merge)

None.

Suggestions (should fix, not blocking)

None.

Nits (optional improvements)

None. The reformat matches isort output exactly and both resulting lines (91 and 50 columns) stay under the 100-column limit, so flake8 is still clean.

What looks good

  • No behavior change: same names, same order, only the wrapping differs.
  • flake8 baseline was already 0 and stays 0; isort is clean after the change.
  • The 18-test bump suite still passes with CUDA available, so the cupy and dask+cupy paths were exercised.

Checklist

  • Algorithm matches reference/paper (unchanged; no algorithm touched)
  • All implemented backends produce consistent results (import-only change; tests pass on all four)
  • NaN handling is correct (unchanged)
  • Edge cases are covered by tests (existing coverage unaffected)
  • Dask chunk boundaries handled correctly (unchanged)
  • No premature materialization or unnecessary copies (no logic change)
  • Benchmark exists or is not needed (not needed for a lint fix)
  • README feature matrix updated (not applicable)
  • Docstrings present and accurate (unchanged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bump.py: isort import-ordering drift (Cat 4)

1 participant