[go: up one dir, main page]

Skip to content
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

_slice_from_grid may need to use coords from a sliced dataarray #945

Closed
kjnam opened this issue Sep 10, 2024 · 0 comments · Fixed by #1003
Closed

_slice_from_grid may need to use coords from a sliced dataarray #945

kjnam opened this issue Sep 10, 2024 · 0 comments · Fixed by #1003
Assignees
Labels
bug Something isn't working

Comments

@kjnam
Copy link
Contributor
kjnam commented Sep 10, 2024

Version

v2024.08.2

How did you install UXarray?

Conda

What happened?

_slice_from_grid in UxDataArray create a new subset dataarray using coordinates info from the original dataarray as shown in the lines below:

return UxDataArray(
uxgrid=sliced_grid,
data=d_var,
name=self.name,
coords=self.coords,
dims=self.dims,
attrs=self.attrs,
)

This does not cause an issue when the original dataarray does not have coordinates that are sliced, but the constructor fails otherwise with a conflicting size for dimension. Probably a better or a right approach is creating a new sliced dataarray with coordinates from the sliced d_var not from the original self.

What did you expect to happen?

A new sliced (subset) dataarray needs to be created with a correctly sliced coordinate variables, not from the original unsliced coordinate variables.

Can you provide a MCVE to repoduce the bug?

No response

@kjnam kjnam added the bug Something isn't working label Sep 10, 2024
@github-project-automation github-project-automation bot moved this to 📚 Backlog in UXarray Development Sep 10, 2024
@philipc2 philipc2 moved this from 📚 Backlog to 📝 To-Do in UXarray Development Oct 9, 2024
@philipc2 philipc2 self-assigned this Oct 9, 2024
@github-project-automation github-project-automation bot moved this from 📝 To-Do to ✅ Done in UXarray Development Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants