Skip to content

Commit

Permalink
Conditionally remove BernoulliLogit (#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Nov 7, 2022
1 parent 416f968 commit ad57181
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Turing"
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
version = "0.21.12"
version = "0.21.13"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down
2 changes: 1 addition & 1 deletion src/Turing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export @model, # modelling
Flat,
FlatPos,
BinomialLogit,
BernoulliLogit,
BernoulliLogit, # Part of Distributions >= 0.25.77
OrderedLogistic,
LogPoisson,
NamedDist,
Expand Down
15 changes: 9 additions & 6 deletions src/stdlib/distributions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ function Base.rand(rng::Random.AbstractRNG, d::BinomialLogit)
end
Distributions.sampler(d::BinomialLogit) = sampler(Binomial(d.n, logistic(d.logitp)))

"""
BernoulliLogit(logitp::Real)
Create a univariate logit-parameterised Bernoulli distribution.
"""
BernoulliLogit(logitp::Real) = BinomialLogit(1, logitp)
# Part of Distributions >= 0.25.77
if !isdefined(Distributions, :BernoulliLogit)
"""
BernoulliLogit(logitp::Real)
Create a univariate logit-parameterised Bernoulli distribution.
"""
BernoulliLogit(logitp::Real) = BinomialLogit(1, logitp)
end

"""
OrderedLogistic(η, c::AbstractVector)
Expand Down

2 comments on commit ad57181

@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/71864

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.21.13 -m "<description of version>" ad57181c1581a8c3fbe2380e4bf0e16f8fda84eb
git push origin v0.21.13

Please sign in to comment.