Skip to content

Commit b220343

Browse files
committed
Replace GLOBAL_RNG by default_rng()
1 parent 3d2172f commit b220343

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/transforms/projectionpursuit.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ------------------------------------------------------------------
44

55
"""
6-
ProjectionPursuit(; tol=1e-6, maxiter=100, deg=5, perc=0.9, n=100, rng=Random.GLOBAL_RNG)
6+
ProjectionPursuit(; tol=1e-6, maxiter=100, deg=5, perc=0.9, n=100, rng=Random.default_rng())
77
88
The projection pursuit multivariate transform converts any multivariate distribution into
99
the standard multivariate Gaussian distribution.
@@ -44,7 +44,7 @@ struct ProjectionPursuit{T,RNG} <: StatelessFeatureTransform
4444
rng::RNG
4545
end
4646

47-
ProjectionPursuit(; tol=1e-6, maxiter=100, deg=5, perc=0.9, n=100, rng=Random.GLOBAL_RNG) =
47+
ProjectionPursuit(; tol=1e-6, maxiter=100, deg=5, perc=0.9, n=100, rng=Random.default_rng()) =
4848
ProjectionPursuit{typeof(tol),typeof(rng)}(tol, maxiter, deg, perc, n, rng)
4949

5050
assertions(::ProjectionPursuit) = [scitypeassert(Continuous)]

src/transforms/sample.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ------------------------------------------------------------------
44

55
"""
6-
Sample(size, [weights]; replace=true, ordered=false, rng=GLOBAL_RNG)
6+
Sample(size, [weights]; replace=true, ordered=false, rng=default_rng())
77
88
Sample `size` rows of table using `weights` with or without replacement depending
99
on the option `replace`. The option `ordered` can be used to return samples in
@@ -33,9 +33,9 @@ struct Sample{W,RNG} <: StatelessFeatureTransform
3333
rng::RNG
3434
end
3535

36-
Sample(size::Int; replace=false, ordered=false, rng=Random.GLOBAL_RNG) = Sample(size, nothing, replace, ordered, rng)
36+
Sample(size::Int; replace=false, ordered=false, rng=Random.default_rng()) = Sample(size, nothing, replace, ordered, rng)
3737

38-
Sample(size::Int, weights::AbstractWeights; replace=false, ordered=false, rng=Random.GLOBAL_RNG) =
38+
Sample(size::Int, weights::AbstractWeights; replace=false, ordered=false, rng=Random.default_rng()) =
3939
Sample(size, weights, replace, ordered, rng)
4040

4141
Sample(size::Int, weights; kwargs...) = Sample(size, Weights(collect(weights)); kwargs...)

test/shows.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133

134134
# compact mode
135135
iostr = sprint(show, T)
136-
@test iostr == "Sample(30, nothing, false, true, Random._GLOBAL_RNG())"
136+
@test iostr == "Sample(30, nothing, false, true, TaskLocalRNG())"
137137

138138
# full mode
139139
iostr = sprint(show, MIME("text/plain"), T)
@@ -143,7 +143,7 @@
143143
├─ weights = nothing
144144
├─ replace = false
145145
├─ ordered = true
146-
└─ rng = Random._GLOBAL_RNG()"""
146+
└─ rng = TaskLocalRNG()"""
147147
end
148148

149149
@testset "Filter" begin

0 commit comments

Comments
 (0)