JuliaVTK / WriteVTK.jl

Julia package for writing VTK XML files
Other
151 stars 32 forks source link

Use StableRNGs to fix nightly tests #135

Closed nhz2 closed 4 months ago

nhz2 commented 4 months ago

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

jipolanco commented 4 months ago

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 commented 4 months ago

randn in StableRNGs seems to be different on 1.11 https://github.com/JuliaRandom/StableRNGs.jl/issues/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.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jipolanco commented 4 months ago

Thanks!