Open ericphanson opened 1 year ago
You can set that Ref: https://github.com/MakieOrg/Makie.jl/blob/master/src/basic_recipes/raincloud.jl#L12
Wouldn't it still be better to have a seed
argument that we could use for all plots having random components? Even though the code says
# A bit of a lazy solution, but it doesn't seem to be desirably to
# pass the RNG through the plotting command
I don't agree with that assessment.
Yeah, I'm happy to have it changed to be a plot attribute!
Ah, thanks for pointing to that Ref. If it uses that then Random.seed!
wouldn’t work (edit: nvm, saw it just points to the global one, so Random.seed!(123)
should be OK).
Agreed with @jkrumbiegel that allowing local config is preferable to global! Also would be nice to get to pass a RNG not just a seed, so we could eg use StableRNGs if desired.
We could make it dispatch depending on whether it's an RNG or an Int? Then the keyword shouldn't be seed
but rng
I guess (even though an Int
would be a seed, but it seems cumbersome for simple cases to pass a whole generator).
Hm, my thinking is this wouldn't be a super common use-case (e.g. most interactive use would be without specifying a seed/rng), so when you do need it it's probably fine to ask the user create the RNG
btw, I got a notification about a failed CI workflow triggered by this issue: https://github.com/MakieOrg/Makie.jl/actions/runs/3565502034. Strange!
So downstream projects can have reproducible CI plots without resorting to
Random.seed!
.