Skip to content

style(pathfinding): drop unused has_dask_array import, fix isort ordering#3658

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-style-pathfinding-2026-07-08-01
Jul 9, 2026
Merged

style(pathfinding): drop unused has_dask_array import, fix isort ordering#3658
brendancol merged 2 commits into
mainfrom
deep-sweep-style-pathfinding-2026-07-08-01

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3650

Style sweep cleanup for xrspatial/pathfinding.py, flagged by the project's own tooling (setup.cfg: flake8 max-line-length=100, isort line_length=100).

  • Cat 3 (F401): dropped has_dask_array from the xrspatial.utils import. It is never used in the module and nothing imports it from xrspatial.pathfinding, so it is a refactor leftover, not a re-export.
  • Cat 4 (isort): ran isort xrspatial/pathfinding.py. Reorders import dask / import dask.array as da, swaps _heap_pop, _heap_push into alphabetical order, grid-wraps the xrspatial.utils block, and adds a blank line after the function-local import cupy.

Not included: the mutable default barriers: list = [] (Cat 5) is item 4 of #3644 and will be fixed there.

No behavioral change intended. Import edits are static and apply uniformly across all four backends.

Test plan:

  • flake8 xrspatial/pathfinding.py clean
  • isort --check-only xrspatial/pathfinding.py clean
  • pytest xrspatial/tests/test_pathfinding.py — 57 passed (CUDA-capable box, cupy paths exercised)

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

https://claude.ai/code/session_0155N4QGamQVxgpAAPbpQNq4

@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: style(pathfinding): drop unused has_dask_array import, fix isort ordering

Style-only change. I verified the two substantive claims against the head branch.

Blockers

None.

Suggestions

None.

Nits

None.

What looks good

  • has_dask_array no longer appears anywhere in pathfinding.py, and nothing imports it from the module. Imports out of xrspatial.pathfinding are limited to a_star_search, multi_stop_search, _available_memory_bytes, and a few test-only helpers, so dropping it is a leftover cleanup, not a broken re-export.
  • The six kept names in the xrspatial.utils block are all still referenced (ngjit 8x, has_cuda_and_cupy 5x, _validate_raster 5x, the rest 3x each), so the grid-wrap didn't strip anything live.
  • The import dask / import dask.array as da reorder, the _heap_pop / _heap_push swap, and the blank line after the function-local import cupy are all cosmetic. No runtime behavior changes.
  • flake8 xrspatial/pathfinding.py and isort --check-only xrspatial/pathfinding.py both come back clean on the branch.

Scoping the mutable-default barriers: list = [] out to #3644 is the right call; keeping this PR to F401 + isort keeps the diff reviewable.

Checklist

  • Imports dropped are genuinely unused and not re-exported
  • Kept imports all still referenced
  • No behavioral change (cosmetic reordering only)
  • flake8 and isort clean on the branch

@brendancol brendancol merged commit 0f4fb3f into main Jul 9, 2026
12 checks passed
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.

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

1 participant