-
Notifications
You must be signed in to change notification settings - Fork 295
Cube.aggregated_by doesn't handle multi-dimensional AuxCoords #1530
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
Comments
Thanks for this @rcomer - particularly for providing a simple (data less!) cube to reproduce. This will make writing a test for any new behaviour much, much easier! 👍 |
I thought I'd have a crack at fixing this, and have a new branch over here. The above example works sensibly with my changes, but now I need to think about writing proper tests. Where should the tests go? I have found tests for aggregated_by in 3 different places: Also feel free to tell me if I shouldn't bother...! |
Thanks! An excellent question about the tests, too. I think the answer is hinted at here in the Iris dev guide – the first tests you've found are the integration tests (checking that the functionality being tested works within the broader setting of Iris), the second set are the current unit tests (checking that the individual code units on their own do what's expected) and the third are the legacy unit tests left over from before we moved to having specific So – focus on new unit tests as required in Again, thanks for taking this on! Hope the testing isn't too arduous... |
Thanks for the explanation @dkillick. There's actually very little in the current unit tests (which is where I looked first and was somewhat surprised!) The legacy tests are a lot more comprehensive so I'm thinking they are still necessary - and they pass with my change in any case. |
Fixed at #3174. |
This follows from a discussion on the Google Group. If an AuxCoord spans more than one dimension, and Cube.aggregated_by is applied over one of those dimensions, the AuxCoord points are simply truncated.
Here's a simple example:
This gives:
which is inconsistent with what we get when applying the aggregation to slices of the cube:
The text was updated successfully, but these errors were encountered: