Skip to content

553 blending weights calculation overwrites weights of other ensemble members#554

Open
larsbonnefoy wants to merge 4 commits into
masterfrom
553-blending-weights-calculation-overwrites-weights-of-other-ensemble-members
Open

553 blending weights calculation overwrites weights of other ensemble members#554
larsbonnefoy wants to merge 4 commits into
masterfrom
553-blending-weights-calculation-overwrites-weights-of-other-ensemble-members

Conversation

@larsbonnefoy

Copy link
Copy Markdown

Previously NWP weights would be overwritten by each worker has they wrote to the same variable storing NWP weights.

The weights are now computed per ensemble member j inside the worker(j) in __blended_nowcast_main_loop, because the NWP skill can differ per member. They are kept on a per-member store (weights_per_member[j], so that members do not overwrite one another.

These changes passes the previous tests but I don't know what should be expected in this newer case and how to write a test for it. I could rely on AI to write one but would have very low confidence in it.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.18%. Comparing base (55653a9) to head (7fc6398).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #554   +/-   ##
=======================================
  Coverage   84.17%   84.18%           
=======================================
  Files         170      170           
  Lines       14985    14989    +4     
=======================================
+ Hits        12614    12618    +4     
  Misses       2371     2371           
Flag Coverage Δ
unit_tests 84.18% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@larsbonnefoy larsbonnefoy requested review from RubenImhoff and ladc June 19, 2026 08:53
@RubenImhoff

Copy link
Copy Markdown
Contributor

Hi @larsbonnefoy, great addition! I will directly have a look at it. If tests are required, I can always add them (although I am on vacation coming week, so it may take a week longer).

@RubenImhoff RubenImhoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great, @larsbonnefoy, well done!

Comment thread pysteps/blending/clim.py Outdated
Co-authored-by: Ruben Imhoff <31476760+RubenImhoff@users.noreply.github.com>
@larsbonnefoy

Copy link
Copy Markdown
Author

Hi @larsbonnefoy, great addition! I will directly have a look at it. If tests are required, I can always add them (although I am on vacation coming week, so it may take a week longer).

If you have an idea of how we could test this I could also write it ! Otherwise do you have concrete example where this led previously to an issue in a pysteps run ? I could always try a rerun of a past case as our domains overlap. Might be able to spot already some differences.

@RubenImhoff

Copy link
Copy Markdown
Contributor

It seems challenging to test, because the models will run successfully without the fix. However, I notice a 'jumpy' behavior in the temporal consistency of the ensemble members. So not sure yet if defining a test is feasible here.

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.

Blending weights calculation overwrites weights of other ensemble members

2 participants