reproject: rename vertical CRS kwargs to source_/target_vertical_crs (#2613)#2626
Merged
brendancol merged 2 commits intoMay 29, 2026
Merged
Conversation
…2613) Align the vertical-datum kwargs with the source_crs/target_crs spelling used elsewhere in the signature. Old names keep working through a deprecation shim that warns and rejects passing both spellings at once. - Add source_vertical_crs / target_vertical_crs params and docstring - Keep src_vertical_crs / tgt_vertical_crs as deprecated aliases - Migrate existing tests to the new names; add back-compat tests
brendancol
commented
May 29, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: reproject vertical CRS kwarg rename
Blockers (must fix before merge)
None.
Suggestions (should fix, not blocking)
None.
Nits (optional improvements)
- Passing the deprecated name with an explicit None (e.g.
src_vertical_crs=None) still emits the DeprecationWarning, since the shim treats any non-sentinel value as "the old name was used" (_resolve_deprecated_vertical_kwarginreproject/__init__.py). That is defensible: the caller did type the old name.
What looks good
- The sentinel-based shim tells "not passed" apart from an explicit None, so the old and new defaults stay independent.
- Passing both spellings for one side raises TypeError, and the new test covers it.
stacklevel=3points the warning at the user's call site rather than the internal helper.- The new and old names were verified on both the numpy and cupy entry points and produce identical output.
- No other call sites in xrspatial, docs, or examples use the old names, so the rename is self-contained.
Checklist
- Algorithm unchanged (signature/shim only)
- Implemented backends consistent (numpy + cupy verified)
- NaN handling unchanged
- Edge cases covered: deprecation warning, both-names conflict
- No premature materialization
- Benchmark not needed (no compute change)
- README feature matrix not applicable
- Docstrings updated for new and deprecated params
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 #2613
src_vertical_crs/tgt_vertical_crstosource_vertical_crs/target_vertical_crsso the vertical-datum kwargs match thesource_crs/target_crsspelling already used in the same signature.DeprecationWarning, and passing both the old and new spelling for the same side raisesTypeError.Backend coverage: the signature is shared across backends (numpy, cupy, dask+numpy, dask+cupy); verified the new and deprecated names on numpy and cupy entry points.
Test plan:
pytest xrspatial/tests/test_reproject.py::TestVerticalShift(14 passed)