Skip to content

Commit 30c8345

Browse files
committed
Merge branch 'tor/tilde-simplification' into tor/sampling-context-simple
2 parents ffb4933 + 671e0b7 commit 30c8345

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DynamicPPL"
22
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
3-
version = "0.11.1"
3+
version = "0.11.2"
44

55
[deps]
66
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
@@ -16,7 +16,7 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
1616
AbstractMCMC = "2, 3.0"
1717
AbstractPPL = "0.1.2"
1818
Bijectors = "0.5.2, 0.6, 0.7, 0.8, 0.9"
19-
ChainRulesCore = "0.9.7"
19+
ChainRulesCore = "0.9.7, 0.10"
2020
Distributions = "0.23.8, 0.24, 0.25"
2121
MacroTools = "0.5.6"
2222
ZygoteRules = "0.2"

src/DynamicPPL.jl

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ export AbstractVarInfo,
8383
PrefixContext,
8484
assume,
8585
dot_assume,
86-
observer,
86+
observe,
8787
dot_observe,
88-
tilde,
89-
dot_tilde,
88+
tilde_assume,
89+
tilde_observe,
90+
dot_tilde_assume,
91+
dot_tilde_observe,
9092
# Pseudo distributions
9193
NamedDist,
9294
NoDist,
@@ -128,4 +130,17 @@ include("compat/ad.jl")
128130
include("loglikelihoods.jl")
129131
include("submodel_macro.jl")
130132

133+
# Deprecations.
134+
@deprecate tilde(rng, ctx, sampler, right, vn, inds, vi) tilde_assume(
135+
rng, ctx, sampler, right, vn, inds, vi
136+
)
137+
@deprecate tilde(ctx, sampler, right, left, vi) tilde_observe(ctx, sampler, right, left, vi)
138+
139+
@deprecate dot_tilde(rng, ctx, sampler, right, left, vn, inds, vi) dot_tilde_assume(
140+
rng, ctx, sampler, right, left, vn, inds, vi
141+
)
142+
@deprecate dot_tilde(ctx, sampler, right, left, vi) dot_tilde_observe(
143+
ctx, sampler, right, left, vi
144+
)
145+
131146
end # module

src/compiler.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,21 @@ check_tilde_rhs(x::AbstractArray{<:Distribution}) = x
5454

5555
"""
5656
unwrap_right_vn(right, vn)
57+
5758
Return the unwrapped distribution on the right-hand side and variable name on the left-hand
5859
side of a `~` expression such as `x ~ Normal()`.
60+
5961
This is used mainly to unwrap `NamedDist` distributions.
6062
"""
6163
unwrap_right_vn(right, vn) = right, vn
6264
unwrap_right_vn(right::NamedDist, vn) = unwrap_right_vn(right.dist, right.name)
6365

6466
"""
6567
unwrap_right_left_vns(right, left, vns)
68+
6669
Return the unwrapped distributions on the right-hand side and values and variable names on the
6770
left-hand side of a `.~` expression such as `x .~ Normal()`.
71+
6872
This is used mainly to unwrap `NamedDist` distributions and adjust the indices of the
6973
variables.
7074
"""

0 commit comments

Comments
 (0)