Repository navigation
Remove deprecated hydro, zonal, focal and classify aliases for 1.0.0 - #3767
Open
brendancol wants to merge 3 commits into
Open
brendancol wants to merge 3 commits into
brendancol wants to merge 3 commits into
Conversation
…reaks legacy-order aliases for 1.0.0 (#3762)
brendancol
commented
Nov 6, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: Remove deprecated hydro, zonal, focal and classify aliases for 1.0.0
Blockers (must fix before merge)
- none
Suggestions (should fix, not blocking)
-
xrspatial/accessor.py:1304: the second commit renames the accessor'scrop(self, zones, zones_ids, **kwargs)parameter tozone_ids. That is a user-visible removal on the.xrssurface (da.xrs.crop(zones, zones_ids=[...])now raises), and neither the PR body nor the migration page in #3761 lists it. Add it to both so the 1.0 migration table is complete.
Nits (optional improvements)
-
xrspatial/tests/test_zonal.py:2262test_crop_zone_ids_does_not_warnfilters caught warnings for the stringzones_ids, which nothing emits any more. It still guards "the canonical kwarg does not warn", so keeping it is fine; the filter string is just stale.
What looks good
applyandhotspotsgo back to a required positionalagg, so a missing input raises Python's ownTypeErrorinstead of the hand-rolled one.supports_datasetbinds the first parameter by name frominspect.signature, so the Dataset path still works (test_dataset_support.pypasses, 20 tests)._resolve_raster_alias,_natural_breaks_legacy_order,basins_d8, thebasinsdispatcher, both accessorbasinsmethods and the_DOC_SOURCE_OVERRIDESentry are all gone together; no orphaned import (warningsin focal,functoolsin classify) is left behind.- Every removed alias has a replacement test asserting the ordinary error, and
test_routing_public_api/test_accessorparameter lists were trimmed so they do not reference removed names. - The
3_Zonalnotebook cell was updated, so the one example that usedzones_ids=keeps working. - Local runs: 672 passed (classify, focal, hydro, accessor), 192 passed (zonal), 98 passed (accessor after the rename).
Checklist
- Algorithm matches reference/paper (n/a, no numerical change)
- All implemented backends produce consistent results (no backend path touched)
- NaN handling is correct (unchanged)
- Edge cases are covered by tests (one removal test per alias)
- Dask chunk boundaries handled correctly (unchanged)
- No premature materialization or unnecessary copies
- Benchmark exists or is not needed
- README feature matrix updated (no row changes needed)
- Docstrings present and accurate (
.. deprecated::notes and thezones_idsentry removed)
brendancol
commented
Nov 6, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: follow-up after review fixes
Disposition of the first-pass findings:
- Suggestion (accessor
croprename not documented): fixed in the PR body; the migration page row lives in #3761 and will be updated there before 1.0.0 is tagged. - Nit (stale
zones_idsfilter intest_crop_zone_ids_does_not_warn): fixed in 078a60c; the test now rejects anyDeprecationWarning.
Nothing new on re-read. Diff since the first review is the one test line.
This was referenced Nov 6, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
This was referenced Nov 6, 2026
Closed
Closed
Closed
Closed
Closed
Closed
This branch has not been deployed
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 #3762
1.0.0 breaking change: the deprecated spellings in hydro, zonal, focal and classify are gone. Each one warned with
DeprecationWarningon 0.10.x. Replacements are on the migration page from #3761 (docs/source/user_guide/migration_1_0.rst).xrspatial.basins,xrspatial.hydro.basins,hydro.watershed_d8.basins_d8,.xrs.basins()basin/basin_d8/.xrs.basin()crop(zones_ids=...)and.xrs.crop(zones, zones_ids=...)crop(zone_ids=...)/.xrs.crop(zones, zone_ids=...)focal.apply(raster=...),hotspots(raster=...)agg=(now the required first parameter)natural_breaks(agg, 20000, k=3)positionalnum_sampleremapnatural_breaks(agg, k=3, num_sample=20000)Old spellings now raise the ordinary
TypeError/AttributeError; no custom messages. The_resolve_raster_aliashelper and the_natural_breaks_legacy_orderwrapper are deleted, along with their orphaned imports.Tests: the alias tests are replaced by one removal test per alias. The
3_Zonalnotebook usedzones_ids=; it now useszone_ids=.basins_d8dropped from the hydrology autosummary.Overlap: this PR also removes the
from xrspatial.hydro import basinsline inxrspatial/__init__.py, which the surface-freeze branchissue-2930removes too. Whichever merges second gets a one-line re-merge.Backends: no runtime path changes; all four backends unaffected beyond the removed keyword.
Test plan:
test_classify.py,test_focal.py,test_accessor.py,hydro/tests/test_watershed_d8.py,test_routing_public_api.py,test_basin_d8.py: 672 passed locallytest_zonal.py: 192 passed locally