Skip to content

Sort surface_distance.py imports with isort - #3715

Open
brendancol wants to merge 2 commits into
mainfrom
deep-sweep-style-surface_distance-2026-08-16
Open

Sort surface_distance.py imports with isort#3715
brendancol wants to merge 2 commits into
mainfrom
deep-sweep-style-surface_distance-2026-08-16

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Fixes #3710.

Runs isort over xrspatial/surface_distance.py so it passes the check the project already configures in setup.cfg (line_length = 100).

Categories addressed

Cat 4 (isort) only. Three things change:

  1. from xrspatial.cost_distance import _heap_push, _heap_pop is alphabetized to _heap_pop, _heap_push.
  2. The two separate from xrspatial.utils import ... statements, split by an unrelated dataset_support import, become one.
  3. The xrspatial.utils block moves from a vertical-hanging-indent wrap to the grid wrap that cost_distance.py, proximity.py, focal.py and zonal.py already use.

No behaviour change is intended and none is possible here: the same names are imported from the same modules, only the order and the wrapping differ. Nothing was added, removed, or re-exported.

flake8 was already clean on this file (0 violations) and stays clean. Cat 1, 2, 3 and 5 turned up nothing to fix.

Verification

$ python -m isort --check-only xrspatial/surface_distance.py   # exit 0
$ python -m flake8 xrspatial/surface_distance.py               # exit 0
$ python -m pytest xrspatial/tests/test_surface_distance.py -q
37 passed in 3.72s

Run on a host with CUDA available, so the cupy and dask+cupy tests in that file ran for real rather than skipping.

Also in this PR

The .claude/sweep-style-state.csv row for surface_distance, including the two LOW findings recorded but deliberately not fixed (the dead height, width unpack in _surface_distance_dask, and _precompute_dd_grid reaching into xrspatial.zonal for a helper this module already defines). Both are described in #3710.

Alphabetize the cost_distance heap helpers, merge the two separate
xrspatial.utils import statements into one, and drop the
vertical-hanging-indent wrap in favour of the layout used by
cost_distance, proximity, focal and zonal.

Import order only; no runtime change.
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.

surface_distance.py fails the project isort check

1 participant