Skip to content

Remove unused xrspatial.analytics module#3602

Merged
brendancol merged 1 commit into
mainfrom
issue-3601
Jul 2, 2026
Merged

Remove unused xrspatial.analytics module#3602
brendancol merged 1 commit into
mainfrom
issue-3601

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3601

What

  • Delete xrspatial/analytics.py (its only function, summarize_terrain, is a thin wrapper over slope/aspect/curvature).
  • Delete its test file xrspatial/tests/test_analytics.py.

Why

The function was never exported from xrspatial/__init__.py, never appeared in the README feature matrix or the docs/ API reference, and has no internal callers (repo-wide grep). Callers who want the same result can call slope, aspect, and curvature directly and assemble the Dataset — that's all the wrapper did.

Removing the module breaks the undocumented from xrspatial.analytics import summarize_terrain import path. See #3601 for the discussion of a deprecation-first alternative.

Backend coverage

Not applicable — this only removes code.

Test plan

  • python -c "import xrspatial" still works
  • pytest xrspatial/tests/ --co collects clean (7616 tests, no import errors)
  • No remaining references to summarize_terrain or the analytics module (the one analytics hit left is an unrelated word in a geotiff/_writers/eager.py docstring)

summarize_terrain was a thin wrapper over slope/aspect/curvature that
was never exported from the package, never documented, and had no
internal callers. Drop the module and its test file.

@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: Remove unused xrspatial.analytics module

This PR deletes xrspatial/analytics.py and its test file, nothing else. The usual domain checks (algorithm accuracy, backend dispatch, dask/cupy kernels, performance) don't apply to a straight removal, so I looked at whether anything still depends on the module and whether the removal leaves the tree consistent.

Blockers

None.

Suggestions

The deprecation-first path raised in #3601 is still open. If a maintainer would rather ship a DeprecationWarning for one release than remove outright, that's their call. The PR takes the hard-removal route, which holds up given the function was never public.

Nits

None.

What looks good

  • The diff is exactly two file deletions, no stray edits. (I caught and fixed a base-branch issue first: the branch had been cut from a feature branch and was dragging unrelated template work into the diff. A rebase onto origin/main cleaned it up.)
  • No remaining importers. A repo-wide grep for summarize_terrain and from xrspatial.analytics comes back empty. The one surviving analytics hit is an unrelated word in a geotiff docstring.
  • import xrspatial still works, and pytest --co collects 7616 tests with no import errors from the removed test file.
  • Nothing in __init__.py, the README matrix, or docs/ pointed at the module, so there are no dangling doc entries.

Checklist

  • Removal leaves no dangling imports or references: verified
  • Package still imports: verified
  • Test suite collects clean: verified
  • No public API or docs entry pointed at the module: verified
  • Breaking change (undocumented import path) noted in the PR body and issue: yes

@brendancol brendancol merged commit 3fdbcc5 into main Jul 2, 2026
10 checks passed
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.

Remove the xrspatial.analytics module

1 participant