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

Fix cf.aggregate for actual_range and np.array properties #765

Merged
merged 12 commits into from
Apr 25, 2024

Conversation

davidhassell
Copy link
Collaborator

Fixes #764

  • Fix bug in cf.aggregate that caused a failure when properties are numpy arrays with two or more elements
  • Fix bug in cf.aggregate that didn't correctly handle the "actual_range" CF attribute

Note

The _equals method can cope with string-valued arguments, so we can simplify the block of code in which it appears

@davidhassell davidhassell added bug Something isn't working aggregation Rerlating to metadata-based field and domain aggregation labels Apr 23, 2024
@davidhassell davidhassell added this to the 3.16.2 milestone Apr 23, 2024
Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

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

Fixes the issue at hand, with good coverage from new testing to expose the bugs (added tests fail on main in the same manner as the bug report, which is always a good sign). I have minor comments but happy overall so merge when ready.

Changelog.rst Outdated Show resolved Hide resolved
cf/aggregate.py Outdated Show resolved Hide resolved
cf/test/test_aggregate.py Outdated Show resolved Hide resolved
cf/aggregate.py Outdated Show resolved Hide resolved
cf/aggregate.py Show resolved Hide resolved
davidhassell and others added 5 commits April 25, 2024 11:48
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
@davidhassell davidhassell merged commit e1af68d into NCAS-CMS:main Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aggregation Rerlating to metadata-based field and domain aggregation bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregate crashes when fields contain the actual_range attribute
2 participants