I expected uxarray to fully support ufuncs without losing object types. For example, np.log10(uxarr) should return a UxDataArray but it returns an xr.DataArray instead.
Here's a decent example to show the bug:
import uxarray as ux
ds = ux.tutorial.open_dataset('quad-hexagon')
arr = ds['t2m'] # arr is a UxDataArray
result0 = np.sqrt(arr)
result0.uxgrid # crashes because result0 is an xr.DataArray
result1 = np.cos(ds)
result1.uxgrid # crashes because result1 is an xr.Dataset
I believe the fix would just involve overriding __apply_ufunc__ appropriately, for UxDataArray and UxDataset.
I expected uxarray to fully support ufuncs without losing object types. For example,
np.log10(uxarr)should return aUxDataArraybut it returns anxr.DataArrayinstead.Here's a decent example to show the bug:
I believe the fix would just involve overriding
__apply_ufunc__appropriately, for UxDataArray and UxDataset.