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

Bugfix reproducibility & ensemble member order with dask #347

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

mpvginde
Copy link
Contributor

@mpvginde mpvginde commented Feb 9, 2024

This PR (hopefully) fixes 2 issues:
#337: Strange artifacts showing up in the STEPS nowcasting due to the random order of the ensemble members in the numpy array when using dask multi-threading

#346: No reproducibility of the (blended) STEPS nowcast results even when a fixed seed argument is given

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 83.32%. Comparing base (be8eea4) to head (a29aa05).
Report is 1 commits behind head on master.

Files Patch % Lines
pysteps/noise/utils.py 76.92% 3 Missing ⚠️
pysteps/io/importers.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
- Coverage   83.34%   83.32%   -0.02%     
==========================================
  Files         161      161              
  Lines       12364    12363       -1     
==========================================
- Hits        10305    10302       -3     
- Misses       2059     2061       +2     
Flag Coverage Δ
unit_tests 83.32% <81.81%> (-0.02%) ⬇️

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

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

@dnerini
Copy link
Member

dnerini commented Feb 12, 2024

Nice job @mpvginde! This looks fantastic and I'm curious to hear from @RubenImhoff about #337.

I was wondering, should we add an explicit test on reproducibility?

@RubenImhoff
Copy link
Contributor

Great work, @mpvginde! I will have a look at the PR later this week. :)

Copy link
Contributor

@RubenImhoff RubenImhoff left a comment

Choose a reason for hiding this comment

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

Hi @mpvginde, great work! This indeed solves the issue. I know that the same issues occurs when using the LINDA nowcasting model. Would a similar fix work there, too?

@dnerini
Copy link
Member

dnerini commented Feb 24, 2024

Hi @mpvginde should we try to push your fixes quickly to master and release them? Do you need any support of the issues that are still open or you think this is now ready to be merged?

@mpvginde
Copy link
Contributor Author

mpvginde commented Feb 26, 2024

Hi @dnerini,
I noticed last week that in some cases, the result was also dependent on the number of dask workers used.
This should be fixed now with the last commit that I added.
I think this can be merged now.
I'm not sure why the Black check is failing though, If somebody could help me with that.

I did notice that the method used for generating the random numbers is using some deprecated numpy-functions.
If I find some more time I will try to update the generation of random number to the latest best practices.
But for now this fix should be ok.

@dnerini
Copy link
Member

dnerini commented Feb 26, 2024

I think this can be merged now.

Brilliant! Just wondering if we should include the fix for the linda method too, as mentioned by @RubenImhoff?

I'm not sure why the Black check is failing though, If somebody could help me with that.

maybe you're using a older version of black locally? during tests we are using the latest available version

@dnerini dnerini merged commit 098927d into pySTEPS:master Mar 5, 2024
8 of 9 checks passed
@dnerini
Copy link
Member

dnerini commented Mar 5, 2024

alright, I'm merging this, thanks a lot @mpvginde for the nice contribution!

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