Skip to content

Fix isort import-ordering in visibility.py#3189

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-style-visibility-2026-06-10
Jun 10, 2026
Merged

Fix isort import-ordering in visibility.py#3189
brendancol merged 2 commits into
mainfrom
deep-sweep-style-visibility-2026-06-10

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3182

Style sweep finding (Cat 4, isort). flake8 reports no violations for this file; isort does.

  • Collapse the from .utils import (...) block to a single line. The one-line form is 92 characters and fits within the configured line_length=100.
  • Alphabetise the deferred from .viewshed import viewshed, INVISIBLE to INVISIBLE, 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.py clean
  • isort --check-only --diff xrspatial/visibility.py clean
  • pytest xrspatial/tests/test_visibility.py — 25 passed

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.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 10, 2026

@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: 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 configured line_length=100. flake8 stays clean.
  • The deferred from .viewshed import keeps its function-local placement (which avoids a circular import with viewshed.py); only the in-line name order changed.
  • The state CSV change adds one visibility row 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

@brendancol brendancol merged commit b8b6d58 into main Jun 10, 2026
6 of 7 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style: isort import-ordering drift in visibility.py

1 participant