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

[Random] Document default_rng and remove references to GLOBAL_RNG #44733

Merged
merged 2 commits into from
Mar 27, 2022

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Mar 24, 2022

Following discussion on Slack. Note: there are still a couple of references to GLOBAL_RNG in the docstring of seed!

seed!([rng=GLOBAL_RNG], seed) -> rng
seed!([rng=GLOBAL_RNG]) -> rng
because as far I can tell that's what's still actually used:
seed!(seed::Union{Nothing,Integer,Vector{UInt32},Vector{UInt64}}=nothing) =
seed!(GLOBAL_RNG, seed)

CC: @cossio

@giordano giordano added domain:docs This change adds or pertains to documentation domain:randomness Random number generation and the Random stdlib labels Mar 24, 2022
@giordano giordano requested a review from rfourquet March 24, 2022 13:36
@rfourquet
Copy link
Member

I think you should also make the change for seed!, the only difference is that GLOBAL_SEED is mutated, but that's an implementation detail.

@giordano
Copy link
Contributor Author

Done, thanks! Now there shouldn't be any more references to GLOBAL_RNG in the documentation.

While the method does use `GLOBAL_RNG` by default, that's an implementation
detail, and it eventually uses `default_rng()` internally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6 Change should be backported to release-1.6 backport 1.8 Change should be backported to release-1.8 domain:docs This change adds or pertains to documentation domain:randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants