zonal_mean() and weighted_mean() should return the same type of object
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start by running the provided MCVE with UxDataArray.zonal_mean() and weighted_mean(), then locate both method implementations and compare how they construct their results. Confirm which return type the project intends for results without grid dimensions, and add or update coverage so both methods consistently return that type.
Written by the indexing model from the issue text.
Description
Version
v2026.08.1
How did you install UXarray?
Source
What happened?
When calling UxDataArray.zonal_mean(), the output is an xarray.DataArray.
When calling UxDataArray.weighted_mean(), the output is a UxDataArray.
What did you expect to happen?
I expected these two functions to return the same type of object.
My guess is that both methods should return an xarray.DataArray because the result no longer contains any grid dimensions, and I've been thinking of "the data lives on the grid" as a core principle of UxDataArray and UxDataset objects. But, maybe that is wrong, and it should be UxDataArray for some reason?
Either way, I would definitely expect them to either both return xarray.DataArray objects or both return UxDataArray objects, because both functions produce results without any grid dimension.
Can you provide a MCVE to repoduce the bug?
import uxarray as ux
arr = ux.tutorial.open_dataset('quad-hexagon')['t2m']
arr.zonal_mean() # this is an xarray.DataArray
arr.weighted_mean() # this is a UxDataArray
- Dominant language
- Python
- Stars
- 228
- Forks
- 55
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UXARRAY/uxarray
-
developer experience
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
new feature visualization
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100