8000 Avoid cell method duplication in ApplyEMOS by gavinevans · Pull Request #2095 · metoppv/improver · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Avoid cell method duplication in ApplyEMOS #2095

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 2 commits into from
Feb 14, 2025

Conversation

gavinevans
Copy link
Contributor

Addresses #https://github.com/metoppv/mo-blue-team/issues/844

This PR removes the potential for cell methods to be duplicated within the ApplyEMOS plugin, when, for example, a probability forecast describing a period is provided.

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

…if probability forecasts are input with an existing cell method e.g. to describe a period diagnostic.
Copy link
codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.40%. Comparing base (84a8944) to head (1fde8ed).
Report is 71 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2095      +/-   ##
==========================================
+ Coverage   98.39%   98.40%   +0.01%     
==========================================
  Files         124      134      +10     
  Lines       12212    13267    +1055     
==========================================
+ Hits        12016    13056    +1040     
- Misses        196      211      +15     

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

@gavinevans gavinevans force-pushed the mobt_844_fix_emos_cell_methods branch from cea6788 to 1fde8ed Compare February 11, 2025 12:37
Copy link
Contributor
@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

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

We could be more selective with the cell_method removal here rather than re-adding cell methods after purging them all, but perhaps the ensemble mean related cell method can vary, which makes removing it more complex.

Either way, this does the job. Thanks Gavin.

@brhooper
Copy link
Contributor

We can talk about this in a stand-up, but I was wondering whether another possible solution to the duplicate cell method problem would be to modify the PostProcessingPlugin class here to ensure cell methods are not duplicated on cubes being returned by any plugin which inherits from this class.

This has the benefit of being more comprehensive than adding individual duplicate handling in different plugins, but might be excessive as it would add additional processing to all plugins which inherit from the class, even if they don't add/modify cell methods.

Copy link
Contributor
@brhooper brhooper left a comment

Choose a reason for hiding this comment

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

After discussion, we've decided that attempting to fix all issues related to duplicate cell methods in the source plugin, as well as a catch-all fix in the save method, is sufficient as a solution for now.

I'm happy that this PR fixes the duplicate cell method issue in this plugin.

@brhooper brhooper merged commit bab8287 into metoppv:master Feb 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0