Skip to content

Added cumulative sum preprocessor #2642

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

Merged
merged 7 commits into from
Jan 24, 2025
Merged

Added cumulative sum preprocessor #2642

merged 7 commits into from
Jan 24, 2025

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Jan 21, 2025

Description

This PR adds the preprocessor cumulative_sum, which calculates cumulative sums along a given coordinate. Corresponding numpy function: np.cumsum.

Example:

preprocessors:
  preproc_cumulative_sum:
    cumulative_sum:
      coord: time
      weights: true

@bouweandela This is necessary for a REF diagnostic which I am currently developing (TCRE), so it would be great to have this in v2.12.0!

Link to documentation: https://esmvaltool--2642.org.readthedocs.build/projects/ESMValCore/en/2642/recipe/preprocessor.html#cumulative-sum


Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added the preprocessor Related to the preprocessor label Jan 21, 2025
@schlunma schlunma added this to the v2.12.0 milestone Jan 21, 2025
@schlunma schlunma requested a review from bouweandela January 21, 2025 17:18
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.99%. Comparing base (31fe0d4) to head (35703ef).
Report is 52 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2642   +/-   ##
=======================================
  Coverage   94.99%   94.99%           
=======================================
  Files         255      255           
  Lines       14793    14824   +31     
=======================================
+ Hits        14052    14082   +30     
- Misses        741      742    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

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

Looks very nice already @schlunma! I left a few questions.

@schlunma schlunma changed the title Added cumsum preprocessor Added cumulative sum preprocessor Jan 23, 2025
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
@sloosvel sloosvel merged commit 1e34201 into main Jan 24, 2025
7 checks passed
@sloosvel sloosvel deleted the cumsum_preproc branch January 24, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preprocessor Related to the preprocessor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants