-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Time coordinate being dropped by apply_as_grid_ufunc #575
Comments
@jbusecke pretty sure this is being caused by the It was a confusing bug to find because all grid-related coordinates are re-attached at the end of |
I see. That is not desirable. Can you come up with a synthetic test case that reproduces this failure as a PR? From what I can remember the issue here is that padding with nans caused a bunch of issues, and thus stripping the coordinates helped. Maybe we can relax the stripping by doing something along these lines? axis_dims = _axis_names_from_boundary_width(boundary_width)
data = _strip_coords(data, axis_dims) # only stripping the dimension coords along the axes that are actually padded. |
I think stripping only coords along dimensions which were padded is fine!
…On Tue, Feb 14, 2023, 3:45 PM Julius Busecke ***@***.***> wrote:
It was a confusing bug to find because all grid-related coordinates are
re-attached at the end of apply_as_grid_ufunc but in this case time is not
in the grid, but it is stripped by _strip_all_coords, so it gets lost.
I see. That is not desirable. Can you come up with a synthetic test case
that reproduces this failure as a PR?
From what I can remember
<https://github.com/xgcm/xgcm/blob/61dca56eecde7c3aabb3eaf4577a39c69fc86cfa/xgcm/padding.py#L406-L409>
the issue here is that padding with nans caused a bunch of issues, and thus
stripping the coordinates helped.
Maybe we can relax the stripping by doing something along these lines?
axis_dims = _axis_names_from_boundary_width(boundary_width)data = _strip_coords(data, axis_dims) # only stripping the dimension coords along the axes that are actually padded.
—
Reply to this email directly, view it on GitHub
<#575 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AISNPI24IWMBSHKLFQXMBB3WXPVH7ANCNFSM6AAAAAAUHSJIUU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
In this notebook the time index gets silently dropped when the grid ufunc is applied. This behavior should be checked by xgcm in keep_coords and so on.
The text was updated successfully, but these errors were encountered: