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 #1445
Overview
While looking into #1445, I noticed that the coordinates in a variable (UxDataArray) were never handled properly as part of our remapping functions in
remap/utils/_construct_remapped_ds(). There was only an attempt to remove coords matching the destination dimension as follows, but even that didn't work since so-calleddestination_dimwas redesigned to beremap_toin the past, and itsLiteralswouldn't be indestination_coords. Also, it doesn't seem like the best way to handle the source coords.This PR now introduces a new module
spatial_coords_remap.pywith the classSpatialCoordsRemapperto perform the following logic to handle remapping of coordinate variables inUxDataArrayaccordingly with the selectedremap_to:These could be done under
remap/utils.py, but since it involves several helper functions, doing it through a separate module and class made more sense to me.Expected Usage
No expected usage of additional code, but when our remap functions are called, the coordinate variables under data variable will now be remapped properly.
Results
See below comment for before and after of the changes here.
PR Checklist
General
Testing
Documentation
_) and have been added todocs/internal_api/index.rstdocs/user_api/index.rstExamples
docs/examples/folderdocs/examples.rsttoctreedocs/gallery.ymlwith appropriate thumbnail photo indocs/_static/thumbnails/