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

Sum is a sum #1649

Merged
merged 7 commits into from Feb 16, 2024
Merged

Sum is a sum #1649

merged 7 commits into from Feb 16, 2024

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • to_agg_units will not change the units when the aggregation is "sum".
  • Fixed the units when the initial data has a temporal dimensionality (ex "m/s") and an "integral" is performed. The output units were previously not reduced, yielding things like "d m s-1".

Does this PR introduce a breaking change?

Yes, but select_resample_op is rarely used by the user directly. And we could consider that this is in fact a fix from a previous ambiguous situation. No internal calls to to_agg_units were using "sum".

xclim/core/units.py Outdated Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@aulemahal aulemahal mentioned this pull request Feb 15, 2024
5 tasks
@aulemahal
Copy link
Collaborator Author

@Zeitsperre All tests fixed. This is ready to go. It will solve the remaining bug in the rolling statistics PR.

Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

Looks great. I'll be merging this in after #1650 !

@github-actions github-actions bot added the approved Approved for additional tests label Feb 16, 2024
@coveralls
Copy link

Coverage Status

coverage: 90.193%. first build
when pulling 9a093f9 on fix-agg-sum
into 5db4a75 on master.

@Zeitsperre Zeitsperre merged commit 07f30af into master Feb 16, 2024
19 checks passed
@Zeitsperre Zeitsperre deleted the fix-agg-sum branch February 16, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Which units should a "sum" aggregation return ?
3 participants