xgcm
xgcm copied to clipboard
Propagated unpadded coords in pad
- [ ] Closes #575
- [x] Tests added
- [x] Passes
pre-commit run --all-files - [ ] User visible changes (including notable bug fixes) are documented in
whats-new.rst - [ ] ~~New functions/methods are listed in
api.rst~~
@jbusecke to fix #575 we need to change _strip_all_coords to instead strip only the coords which are a function of the padded dimensions. Therefore we need a function like
def _strip_axis_coords(da, padding_axes):
...
For _pad_basic this is fine, but for face-connected grids its the implementation is a bit more complicated because pad_axes is not known until after you know you have a face-connected grid.
Instead how about we move the coordinate stripping inside of _pad_basic?
For _pad_basic this is fine, but for face-connected grids its the implementation is a bit more complicated because pad_axes is not known until after you know you have a face-connected grid.
I am not sure I follow this entirely. But could we do something like this:
def _strip_all_axis_coords(da, grid):
# get rid of any dim that is associated with a grid axis
...
If I understand this correctly, the problem was not with dims associated with an axis that is not being padded, but instead with dims that are not associated with any axis? This approach would strip more than is needed, but would still probably work?
@TomNicholas I am starting to get back into hopefully more regular maintainer duties. Do you have any time soon to check in on this? Happy to meet up and figure this out too.