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

Use StableRNGs to fix nightly tests #135

Merged
merged 4 commits into from
Mar 3, 2024
Merged

Conversation

nhz2
Copy link
Contributor

@nhz2 nhz2 commented Mar 1, 2024

This PR prevents the test from failing in new versions of Julia if the random number generator changes.

@jipolanco
Copy link
Member

Great, thank you!

Some tests don't pass, maybe not all checksums have been updated? (I haven't tested on my side.)

Just a comment, I would expect StableRNGs to do the right thing and return reproducible values when doing randn(rng). That way we wouldn't need to define a my_randn function. Can this be checked?

@nhz2
Copy link
Contributor Author

nhz2 commented Mar 2, 2024

randn in StableRNGs seems to be different on 1.11 JuliaRandom/StableRNGs.jl#20 but I think this will be fixed eventually.
my_randn was returning different values in julia 1.6 because the rounding in cospi changed. I updated the PR to use rand instead of randn which should be more stable.

@nhz2 nhz2 marked this pull request as ready for review March 2, 2024 19:02
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.63%. Comparing base (8e1c1d1) to head (eacccef).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   96.63%   96.63%           
=======================================
  Files          15       15           
  Lines         832      832           
=======================================
  Hits          804      804           
  Misses         28       28           

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

@jipolanco jipolanco merged commit da618b2 into JuliaVTK:master Mar 3, 2024
7 checks passed
@jipolanco
Copy link
Member

Thanks!

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.

2 participants