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

Fixed aggregate_by bug for single values coordinates. #1203

Closed
wants to merge 1 commit into from

Conversation

pelson
Copy link
Member

@pelson pelson commented Jun 26, 2014

Closes #1183.

@pelson pelson added the bug label Jun 26, 2014
@pelson pelson added this to the v1.7 milestone Jun 26, 2014
result = cube.aggregated_by('foo', MEAN)
self.assertEqual(result.shape, (2, 4))
self.assertEqual(result.coord('bar'),
AuxCoord(['a|a', 'a|a'], long_name='bar'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right to me. I'd have thought you'd get

AuxCoord(['a|a', 'a'], long_name='bar')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I'm always using the two bounds from the slice, even if they are the same thing.
I believe this to be consistent with the existing behaviour (when it doesn't break) - I was tempted to try making this better (and did start doing so) but it wasn't as trivial a fix. If you want me to though, I'd happily look into the prospect of only joining if there is more than one value.

@pelson
Copy link
Member Author

pelson commented Jun 26, 2014

Closing this PR - I'll take @esc24's suggestion on board an make a new PR targeting v1.7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug (with fix?) in month name stitching for aggregate_by()
3 participants