Fix isort import-ordering in visibility.py#3189
Merged
Merged
Conversation
Style sweep Cat 4 (isort), MEDIUM. Collapse the .utils import block to a single line (92 chars, within line_length=100) and alphabetise the deferred .viewshed import to INVISIBLE, viewshed. Import-ordering only, no behaviour change. flake8 + isort clean; 25 visibility tests pass. Also record the visibility row in the sweep-style state CSV.
brendancol
commented
Jun 10, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: Fix isort import-ordering in visibility.py
Blockers (must fix before merge)
None.
Suggestions (should fix, not blocking)
None.
Nits (optional improvements)
None.
What looks good
- Both edits are import-ordering only. The imported names are identical before and after, so there is no runtime change.
- The collapsed
from .utils import ...line is 92 characters, within the configuredline_length=100. flake8 stays clean. - The deferred
from .viewshed importkeeps its function-local placement (which avoids a circular import withviewshed.py); only the in-line name order changed. - The state CSV change adds one
visibilityrow and leaves the other rows untouched.
Checklist
- Algorithm matches reference/paper -- N/A, no logic change
- All implemented backends produce consistent results -- N/A, static reorder
- NaN handling is correct -- N/A
- Edge cases covered by tests -- existing 25 tests pass
- No premature materialization or unnecessary copies -- N/A
- Benchmark exists or is not needed -- not needed
- README feature matrix updated -- N/A, no new function
- Docstrings present and accurate -- unchanged
…bility-2026-06-10
brendancol
added a commit
that referenced
this pull request
Jun 10, 2026
Conflicts: - .claude/sweep-performance-state.csv: main normalized the file to LF and updated the rasterize row; this branch updated the visibility row. Took main's LF file and reapplied the branch's visibility row. xrspatial/visibility.py auto-merged (main side was the isort-only #3189).
brendancol
added a commit
that referenced
this pull request
Jun 11, 2026
…isibility-2026-06-10 Conflicts: - .claude/sweep-metadata-state.csv: took main's copy (LF line endings, newer rows for other modules) and re-inserted this branch's visibility row; diff vs main is exactly that one row. - xrspatial/visibility.py auto-merged: main's isort import ordering (#3189) composed with this branch's cupy accumulator change.
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 #3182
Style sweep finding (Cat 4, isort). flake8 reports no violations for this file; isort does.
from .utils import (...)block to a single line. The one-line form is 92 characters and fits within the configuredline_length=100.from .viewshed import viewshed, INVISIBLEtoINVISIBLE, viewshed.Import-ordering only, no behaviour change. Confirmed for Cat 4: no Cat 1/2/3/5 findings (grep clean for bare except, mutable defaults,
==None/True, and shadowed builtins).Backends: not applicable. Static import reorder applies uniformly across numpy / cupy / dask paths.
Test plan
flake8 xrspatial/visibility.pycleanisort --check-only --diff xrspatial/visibility.pycleanpytest xrspatial/tests/test_visibility.py— 25 passed