Skip to content

Commit

Permalink
Use Random.default_rng() instead of Random.GLOBAL_RNG (#80)
Browse files Browse the repository at this point in the history
* Use `Random.default_rng()` instead of `Random.GLOBAL_RNG`

* Adjust tolerance of test

* Update Project.toml
  • Loading branch information
devmotion authored Mar 12, 2023
1 parent 658191d commit ae82171
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AdvancedMH"
uuid = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
version = "0.7.3"
version = "0.7.4"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down
2 changes: 1 addition & 1 deletion src/proposal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function RandomWalkProposal{issymmetric}(proposal) where {issymmetric}
end

# Random draws
Base.rand(p::Proposal, args...) = rand(Random.GLOBAL_RNG, p, args...)
Base.rand(p::Proposal, args...) = rand(Random.default_rng(), p, args...)
Base.rand(rng::Random.AbstractRNG, p::Proposal{<:Distribution}) = rand(rng, p.proposal)
function Base.rand(rng::Random.AbstractRNG, p::Proposal{<:AbstractArray})
return map(x -> rand(rng, x), p.proposal)
Expand Down

2 comments on commit ae82171

@devmotion
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/79438

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.4 -m "<description of version>" ae82171f2e464acdfdf2896d74666e130e460260
git push origin v0.7.4

Please sign in to comment.