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

Weighted aggregated_by #4581

Closed
schlunma opened this issue Feb 10, 2022 · 1 comment · Fixed by #4589
Closed

Weighted aggregated_by #4581

schlunma opened this issue Feb 10, 2022 · 1 comment · Fixed by #4589
Assignees
Labels
Peloton 🚴‍♂️ Target a breakaway issue to be caught and closed by the peloton

Comments

@schlunma
Copy link
Contributor

✨ Feature Request

Similar to iris.cube.Cube.collapsed, it would be nice if iris.cube.Cube.aggregated_by could also support weights.

Motivation

iris.cube.Cube.aggregated_by currently does not support weights. Using weights in aggregated_by might be helpful in lots of use cases, e.g., when calculating annual means for monthly data where the months have a different number of days.

Additional context

I tried to implement this for the non-lazy case (see this commit). It actually doesn't require a lot of changes. If you think this feature is helpful, I can come up with a solution for the lazy case and open a pull request.

Thanks!!

@rcomer
Copy link
Member

rcomer commented Feb 11, 2022

This has been requested before - #3290, so seems like a good idea to me. There was talk in that issue of rationalising some of the collapsed/aggregated_by code though, which would have made it a bigger task I guess.

@lbdreyer lbdreyer added Peloton 🚴‍♂️ Target a breakaway issue to be caught and closed by the peloton and removed New: Feature labels Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Peloton 🚴‍♂️ Target a breakaway issue to be caught and closed by the peloton
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants