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 docs This change adds or pertains to documentation randomness Random number generation and the Random stdlib labels Mar 24, 2022
@giordano giordano requested a review from rfourquet March 24, 2022 13:36
@giordano giordano force-pushed the mg/doc-default-rng branch from d3e15a2 to 7df432a Compare March 24, 2022 13:37
@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.

@giordano giordano force-pushed the mg/doc-default-rng branch from dd8710e to 33cfe0c Compare March 24, 2022 14:12
While the method does use `GLOBAL_RNG` by default, that's an implementation
detail, and it eventually uses `default_rng()` internally.
@giordano giordano force-pushed the mg/doc-default-rng branch from 33cfe0c to 3818204 Compare March 24, 2022 16:24
@giordano giordano merged commit b297cc4 into JuliaLang:master Mar 27, 2022
@giordano giordano deleted the mg/doc-default-rng branch March 27, 2022 22:31
@giordano giordano added backport 1.6 Change should be backported to release-1.6 backport 1.8 Change should be backported to release-1.8 labels Feb 16, 2023
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 docs This change adds or pertains to documentation randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants