UXARRAY / uxarray

Xarray extension for unstructured climate and global weather data analysis and visualization.
https://uxarray.readthedocs.io/
Apache License 2.0
148 stars 31 forks source link

`_slice_from_grid` creates a tuple for the node centered case unlike the other cases #862

Closed kjnam closed 1 month ago

kjnam commented 1 month ago

Version

v2024.06.0

How did you install UXarray?

Conda

What happened?

_slice_from_grid function in dataarray.py creates a tuple for the node centered case, unlike the other two cases. https://github.com/UXARRAY/uxarray/blob/49fd637bb96b193e9e1d011396f56d4f35a73267/uxarray/core/dataarray.py#L1075-L1080 This causes a ValueError exception due to a wrong dim while creating a new UxDataArray in the following lines. The UxDataArray constructor expects a numpy array for the data.

What did you expect to happen?

I was expecting that the function slices and creates a subset UxDataArray for the node centered dataset without an error.

Can you provide a MCVE to repoduce the bug?

No response