Summary
xrspatial.zonal.crop() accepts the parameter zones_ids (with the extra s),
while every other zonal function uses zone_ids for the same concept:
zonal.stats(..., zone_ids=...)
zonal.crosstab(..., zone_ids=...)
zonal.crop(zones, values, zones_ids=...) <-- inconsistent
Users who learn the convention from stats/crosstab will get a
TypeError when calling crop, and vice versa.
API Consistency Sweep Context
Found by the api-consistency sweep against the zonal module
(2026-05-27). Severity: HIGH (Cat 1 — parameter naming drift, both names
exist concurrently in the public API).
Proposed Fix (Deprecation Shim)
Since this is a breaking rename, the fix should:
- Accept both
zone_ids (new, canonical) and zones_ids (legacy).
- Emit a
DeprecationWarning when zones_ids is used.
- Raise if both are supplied.
- Update the docstring and the in-tree examples/tests to use
zone_ids.
- Keep
zones_ids working for at least one release cycle.
Test Plan
- Existing
test_crop() keeps passing (uses zones_ids, will emit
DeprecationWarning but still work).
- New test: calling
crop(..., zone_ids=...) works identically.
- New test: passing both raises
TypeError.
- New test:
zones_ids triggers DeprecationWarning.
Summary
xrspatial.zonal.crop()accepts the parameterzones_ids(with the extras),while every other zonal function uses
zone_idsfor the same concept:zonal.stats(..., zone_ids=...)zonal.crosstab(..., zone_ids=...)zonal.crop(zones, values, zones_ids=...)<-- inconsistentUsers who learn the convention from
stats/crosstabwill get aTypeErrorwhen callingcrop, and vice versa.API Consistency Sweep Context
Found by the api-consistency sweep against the
zonalmodule(2026-05-27). Severity: HIGH (Cat 1 — parameter naming drift, both names
exist concurrently in the public API).
Proposed Fix (Deprecation Shim)
Since this is a breaking rename, the fix should:
zone_ids(new, canonical) andzones_ids(legacy).DeprecationWarningwhenzones_idsis used.zone_ids.zones_idsworking for at least one release cycle.Test Plan
test_crop()keeps passing (useszones_ids, will emitDeprecationWarning but still work).
crop(..., zone_ids=...)works identically.TypeError.zones_idstriggersDeprecationWarning.