You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shouldn't zonal_mean return xarray.DataArray instead of UxDataArray? #1370
Similar to the comment here and the following conversation and corresponding implementation, zonal_mean also needs some re-design regarding the returned data type:
Currently it returns uxarray.UxDataArray, but it should only be a list of average values, without any Grid topology attempted to be preserved/created I believe.
How it is currently showcased in our user guides seems to kind of support this as well because all the resulting zonal means needed to be used with line or scatter plots and no use of grid topology at all.
All that said, I think a return type of xarray.DataArray would be better here.
@philipc2, feel free to chime in since you were there in the original convo above.
@rajeeja , if we agree with this way forward, would you mind looking into this since you're already working on zonal_mean for conservative averaging?
Thanks for raising this issue. —I'll switch zonal_mean to return an xr.DataArray (1D over 'latitudes', no grid topology), preserve attrs (conservative, lat_band_edges)
Activity
philipc2 commentedon Sep 15, 2025
Good point! It makes more sense to return an
xr.DataArrayrajeeja commentedon Sep 15, 2025
Thanks for raising this issue. —I'll switch zonal_mean to return an xr.DataArray (1D over 'latitudes', no grid topology), preserve attrs (conservative, lat_band_edges)
erogluorhan commentedon Sep 15, 2025
Sounds great; thanks @rajeeja !