Skip to content

Commit ad57181

Browse files
authored
Conditionally remove BernoulliLogit (#1892)
1 parent 416f968 commit ad57181

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Turing"
22
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
3-
version = "0.21.12"
3+
version = "0.21.13"
44

55
[deps]
66
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"

src/Turing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export @model, # modelling
140140
Flat,
141141
FlatPos,
142142
BinomialLogit,
143-
BernoulliLogit,
143+
BernoulliLogit, # Part of Distributions >= 0.25.77
144144
OrderedLogistic,
145145
LogPoisson,
146146
NamedDist,

src/stdlib/distributions.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,15 @@ function Base.rand(rng::Random.AbstractRNG, d::BinomialLogit)
109109
end
110110
Distributions.sampler(d::BinomialLogit) = sampler(Binomial(d.n, logistic(d.logitp)))
111111

112-
"""
113-
BernoulliLogit(logitp::Real)
114-
115-
Create a univariate logit-parameterised Bernoulli distribution.
116-
"""
117-
BernoulliLogit(logitp::Real) = BinomialLogit(1, logitp)
112+
# Part of Distributions >= 0.25.77
113+
if !isdefined(Distributions, :BernoulliLogit)
114+
"""
115+
BernoulliLogit(logitp::Real)
116+
117+
Create a univariate logit-parameterised Bernoulli distribution.
118+
"""
119+
BernoulliLogit(logitp::Real) = BinomialLogit(1, logitp)
120+
end
118121

119122
"""
120123
OrderedLogistic(η, c::AbstractVector)

0 commit comments

Comments
 (0)