Skip to content

perlin: remove unused import and fix import ordering#3466

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-style-perlin-2026-06-23
Jun 23, 2026
Merged

perlin: remove unused import and fix import ordering#3466
brendancol merged 2 commits into
mainfrom
deep-sweep-style-perlin-2026-06-23

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

What

Style sweep cleanup for xrspatial/perlin.py. Two findings from the
project's own tooling (setup.cfg), neither gated in CI:

  • flake8 F401: not_implemented_func was imported from xrspatial.utils
    and never used. It's a refactor leftover. The name isn't re-exported
    (only perlin leaves the module via xrspatial/__init__.py), so
    dropping it doesn't touch the public API.
  • isort: the from xrspatial.utils import (...) line now wraps to the
    configured line_length=100.

Backends

No behavioural change. Style fixes are static and apply uniformly across
numpy / cupy / dask+numpy / dask+cupy.

Test plan

  • flake8 xrspatial/perlin.py clean
  • isort --check-only --diff xrspatial/perlin.py clean
  • import xrspatial.perlin and from xrspatial import perlin both ok
  • pytest xrspatial/tests/test_perlin.py -> 12 passed (CUDA available)

Note: GitHub issues are disabled on this repo, so there's no linked
issue. State recorded in .claude/sweep-style-state.csv.

Cat 3 (F401) + Cat 4 (isort) style sweep findings. The import was a
refactor leftover and is not re-exported (only perlin leaves the module
via xrspatial/__init__.py), so there is no behavioural change on any
backend. flake8 and isort clean after the fix; 12 perlin tests pass.

@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: perlin: remove unused import and fix import ordering

Import-only style cleanup. I read perlin.py in full and confirmed the
four names kept on the import line are all referenced in the module:
ArrayTypeFunctionMapping and cuda_args in _perlin_cupy / dispatch,
_dask_task_name_kwargs in both dask paths, _validate_raster in perlin().
not_implemented_func had no use anywhere and isn't re-exported, so
dropping it is safe.

Blockers

None.

Suggestions

None.

Nits

None.

What looks good

  • flake8 and isort both clean after the change.
  • No behavioural change: the removed name was never called, and the
    re-wrap is whitespace only.
  • test_perlin.py passes (12 tests), so the numpy/cupy/dask dispatch
    still imports and runs.

Checklist

  • No behavioural change (import-only)
  • Remaining imports all used
  • Removed name not re-exported (only perlin leaves the module)
  • flake8 + isort clean
  • Existing tests pass
  • [n/a] Algorithm / NaN / dask-boundary / benchmark / README -- no logic touched

@brendancol brendancol merged commit c4d0838 into main Jun 23, 2026
10 checks passed
@brendancol brendancol deleted the deep-sweep-style-perlin-2026-06-23 branch June 25, 2026 14:55
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.

1 participant