surface_distance.py fails the project isort check
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Start with xrspatial/surface_distance.py and run python -m isort --check-only --diff xrspatial/surface_distance.py using the line_length = 100 setting in setup.cfg. Compare the import layout with cost_distance.py, proximity.py, focal.py, and zonal.py. Done means the imports are reordered only, with the isort check passing and no names or runtime behavior changed.
Written by the indexing model from the issue text.
Description
xrspatial/surface_distance.py fails the project's isort check. setup.cfg configures isort with line_length = 100, but no CI job runs it, so the drift went unnoticed.
Reproduction
$ python -m isort --check-only --diff xrspatial/surface_distance.py
ERROR: xrspatial/surface_distance.py Imports are incorrectly sorted and/or formatted.
--- xrspatial/surface_distance.py:before
+++ xrspatial/surface_distance.py:after
@@ -47,15 +47,12 @@
-from xrspatial.cost_distance import _heap_push, _heap_pop
+from xrspatial.cost_distance import _heap_pop, _heap_push
+from xrspatial.dataset_support import supports_dataset
from xrspatial.proximity import _vectorized_calc_direction
-from xrspatial.utils import (
- _validate_raster,
- cuda_args, get_dataarray_resolution, ngjit,
- has_cuda_and_cupy, is_cupy_array, is_dask_cupy,
-)
-from xrspatial.dataset_support import supports_dataset
-from xrspatial.utils import _dask_task_name_kwargs
+from xrspatial.utils import (_dask_task_name_kwargs, _validate_raster, cuda_args,
+ get_dataarray_resolution, has_cuda_and_cupy, is_cupy_array,
+ is_dask_cupy, ngjit)
Three things are off:
_heap_push, _heap_popare out of alphabetical order.xrspatial.utilsis imported twice, in two statements separated by an unrelated import.- The wrapped
xrspatial.utilsblock uses a hanging-indent style that its nearest neighbours do not.cost_distance.py,proximity.py,focal.pyandzonal.pyall already carry the exact layout isort wants here, so this file is the outlier among the modules it borrows from.
flake8 is clean on this file (0 violations), so this is purely the isort side.
Scope
Import reordering only. No runtime behaviour change, no names added or removed.
Found by a style sweep of surface_distance. Two smaller things turned up that are not worth a code change on their own, noted here so nobody has to rediscover them:
_surface_distance_daskunpacksheight, width = source_da.shapeand never uses either name. pyflakes skips F841 for tuple unpacking, so flake8 misses it._precompute_dd_gridimports_available_memory_bytesfromxrspatial.zonaleven though this module defines its own copy of that helper at the top. Both work; the local one is right there.
- Dominant language
- Python
- Stars
- 972
- Forks
- 92
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/xarray-spatial
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
xarray-contrib/xarray-spatial#3726 ·
-
api area:surface bug severity:medium sweep-api-consistency
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
xarray-contrib/xarray-spatial#3712 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3707 ·
-
area:surface documentation user-guide-example
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
xarray-contrib/xarray-spatial#3464 ·
-
area:analysis documentation user-guide-example
Difficulty 2/5 Half a day Newbie friendliness 78/100
xarray-contrib/xarray-spatial#3463 ·
All issues in xarray-contrib/xarray-spatial
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100