Fixed a half-pixel shift in affine transformation#20
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
=======================================
Coverage 98.85% 98.85%
=======================================
Files 22 22
Lines 2182 2183 +1
=======================================
+ Hits 2157 2158 +1
Misses 25 25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b-yogesh
reviewed
Jan 16, 2026
b-yogesh
left a comment
Member
There was a problem hiding this comment.
LGTM. Please look at my questions. Also, please change the title of this PR.
b-yogesh
approved these changes
Jan 26, 2026
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.
Fixed a half-pixel shift that occurred in
xcube_resampling.affine_transform_datasetand
xcube_resampling.resample_in_spacewhen the source and target grid mappingsshared the same CRS and were regular.
Little example
We create a coarse small dataset:
Now, we interpolate this dataset to a fine grid (affine transformation)
Old verson:

With the changes in this PR:

new_version.ipynb
old_version.ipynb
Checklist:
Add unit tests and/or doctests in docstringsAdd docstrings and API docs for any new/modified user-facing classes and functionsNew/modified features documented indocs/CHANGES.md