From 7ef0d0ecd97719dddab49b6fca297f965d9c4aa2 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sun, 8 Feb 2026 09:02:11 -0500 Subject: [PATCH] Replace Random.GLOBAL_RNG with Random.default_rng() Random.GLOBAL_RNG is not exported from Random and is not part of the public API. Replace with Random.default_rng() which is the supported public interface. Both return TaskLocalRNG on modern Julia versions, so this is a no-op behavior change but future-proofs against GLOBAL_RNG being deprecated. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.6 --- src/PoissonRandom.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PoissonRandom.jl b/src/PoissonRandom.jl index 14b08a4..f8245c0 100644 --- a/src/PoissonRandom.jl +++ b/src/PoissonRandom.jl @@ -13,7 +13,7 @@ Random.rand(rng::PassthroughRNG) = rand() Random.randexp(rng::PassthroughRNG) = randexp() Random.randn(rng::PassthroughRNG) = randn() -count_rand(λ::Real) = count_rand(Random.GLOBAL_RNG, λ) +count_rand(λ::Real) = count_rand(Random.default_rng(), λ) function count_rand(rng::AbstractRNG, λ::Real) n = 0 c = randexp(rng) @@ -32,7 +32,7 @@ end # # For μ sufficiently large, (i.e. >= 10.0) # -ad_rand(λ::Real) = ad_rand(Random.GLOBAL_RNG, λ) +ad_rand(λ::Real) = ad_rand(Random.default_rng(), λ) function ad_rand(rng::AbstractRNG, λ::Real) s = sqrt(λ) d = 6 * λ^2 @@ -135,7 +135,7 @@ pois_rand(rng, λ) pois_rand(PoissonRandom.PassthroughRNG(), λ) ``` """ -pois_rand(λ::Real) = pois_rand(Random.GLOBAL_RNG, λ) +pois_rand(λ::Real) = pois_rand(Random.default_rng(), λ) pois_rand(rng::AbstractRNG, λ::Real) = λ < 6 ? count_rand(rng, λ) : ad_rand(rng, λ) @compile_workload begin