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 a stable RNG in fakedata #3661

Merged
merged 3 commits into from
Jul 23, 2021
Merged

Use a stable RNG in fakedata #3661

merged 3 commits into from
Jul 23, 2021

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Jul 22, 2021

Failures have been seen on nightly, change to a more stable random number generator.

@BeastyBlacksmith, if this is OK for you I will re-generate ref images.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Jul 22, 2021

You'd need to move StableRNG from [extras] to [deps] in Project.toml, no?

@t-bltg
Copy link
Member Author

t-bltg commented Jul 22, 2021

You'd need to move StableRNG from [extras] to [deps] in Project.toml, no?

Yes, done.

@BeastyBlacksmith
Copy link
Member

Thogh, I'd prefer that this stays a testdependency and you only allow passing a rng to fakedate and then pass the stable rng in the tests

@t-bltg
Copy link
Member Author

t-bltg commented Jul 22, 2021

Thogh, I'd prefer that this stays a testdependency and you only allow passing a rng to fakedate and then pass the stable rng in the tests

IMO, Plots.fakedata() is exposed to the user throughout src/examples.jl, so moving StableRNGs from extras to deps is justified. And also Plots.fakedata() resides in src/utils.jl, not in test/.

@t-bltg t-bltg marked this pull request as draft July 22, 2021 10:06
@t-bltg t-bltg force-pushed the rng branch 4 times, most recently from be1a29f to fc4060f Compare July 22, 2021 10:28
t-bltg added a commit to t-bltg/PlotReferenceImages.jl that referenced this pull request Jul 22, 2021
t-bltg added a commit to t-bltg/PlotReferenceImages.jl that referenced this pull request Jul 22, 2021
@t-bltg t-bltg marked this pull request as ready for review July 22, 2021 10:32
@t-bltg t-bltg force-pushed the rng branch 2 times, most recently from 515f704 to bd94832 Compare July 22, 2021 10:52
@t-bltg
Copy link
Member Author

t-bltg commented Jul 22, 2021

@BeastyBlacksmith all the test run with JuliaPlots/PlotReferenceImages.jl#106.
I've also replaced download (deprecated) with Downloads.download.

src/utils.jl Outdated Show resolved Hide resolved
Co-authored-by: Simon Christ <SimonChrist@gmx.de>
@t-bltg
Copy link
Member Author

t-bltg commented Jul 23, 2021

Should we then hack again examples in replace_rand! to insert a keyword argument or should we modify the examples using Plots.fakedata ?

@t-bltg t-bltg force-pushed the rng branch 3 times, most recently from 40ef655 to cc1a328 Compare July 23, 2021 09:47
@BeastyBlacksmith
Copy link
Member

I'd shadow it in the tests like fakedata(args...) = Plots.fakedata(args...; rng=StableRNG(Plots.PLOTS_SEED))

@t-bltg
Copy link
Member Author

t-bltg commented Jul 23, 2021

I'd shadow it in the tests like fakedata(args...) = Plots.fakedata(args...; rng=StableRNG(Plots.PLOTS_SEED))

Yeah that's more or less what I came up with.

@t-bltg t-bltg requested a review from BeastyBlacksmith July 23, 2021 10:20
Project.toml Outdated Show resolved Hide resolved
src/Plots.jl Outdated Show resolved Hide resolved
test/imgcomp.jl Outdated Show resolved Hide resolved
@t-bltg t-bltg force-pushed the rng branch 3 times, most recently from 8411c22 to 90e3fc0 Compare July 23, 2021 12:10
@t-bltg t-bltg requested a review from BeastyBlacksmith July 23, 2021 12:17
Copy link
Member

@BeastyBlacksmith BeastyBlacksmith left a comment

Choose a reason for hiding this comment

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

Still needs new reference figures

@t-bltg
Copy link
Member Author

t-bltg commented Jul 23, 2021

Still needs new reference figures

Yes, there are already here: JuliaPlots/PlotReferenceImages.jl#106. I will merge them now, if you're ok with that.

t-bltg added a commit to JuliaPlots/PlotReferenceImages.jl that referenced this pull request Jul 23, 2021
@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #3661 (4e72c86) into master (a39582c) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head 4e72c86 differs from pull request most recent head f3aa612. Consider uploading reports for the commit f3aa612 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3661      +/-   ##
==========================================
- Coverage   63.88%   63.80%   -0.09%     
==========================================
  Files          28       28              
  Lines        6923     6924       +1     
==========================================
- Hits         4423     4418       -5     
- Misses       2500     2506       +6     
Impacted Files Coverage Δ
src/Plots.jl 31.42% <ø> (ø)
src/examples.jl 61.76% <ø> (ø)
src/utils.jl 52.62% <100.00%> (+0.08%) ⬆️
src/recipes.jl 57.64% <0.00%> (-0.46%) ⬇️
src/axes.jl 84.75% <0.00%> (-0.45%) ⬇️
src/layouts.jl 68.22% <0.00%> (-0.27%) ⬇️
src/colorbars.jl 92.15% <0.00%> (+1.96%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a39582c...f3aa612. Read the comment docs.

@t-bltg
Copy link
Member Author

t-bltg commented Jul 23, 2021

Failures are related to GraphRecipes, made a PR there: JuliaPlots/GraphRecipes.jl#162.

@t-bltg t-bltg merged commit 878e590 into JuliaPlots:master Jul 23, 2021
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