style(pathfinding): drop unused has_dask_array import, fix isort ordering#3658
Merged
Merged
Conversation
brendancol
commented
Jul 9, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
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_arrayno longer appears anywhere inpathfinding.py, and nothing imports it from the module. Imports out ofxrspatial.pathfindingare limited toa_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.utilsblock are all still referenced (ngjit8x,has_cuda_and_cupy5x,_validate_raster5x, the rest 3x each), so the grid-wrap didn't strip anything live. - The
import dask/import dask.array as dareorder, the_heap_pop/_heap_pushswap, and the blank line after the function-localimport cupyare all cosmetic. No runtime behavior changes. flake8 xrspatial/pathfinding.pyandisort --check-only xrspatial/pathfinding.pyboth 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3650
Style sweep cleanup for
xrspatial/pathfinding.py, flagged by the project's own tooling (setup.cfg: flake8max-line-length=100, isortline_length=100).has_dask_arrayfrom thexrspatial.utilsimport. It is never used in the module and nothing imports it fromxrspatial.pathfinding, so it is a refactor leftover, not a re-export.isort xrspatial/pathfinding.py. Reordersimport dask/import dask.array as da, swaps_heap_pop, _heap_pushinto alphabetical order, grid-wraps thexrspatial.utilsblock, and adds a blank line after the function-localimport 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.pycleanisort --check-only xrspatial/pathfinding.pycleanpytest 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