Skip to content

Commit 0e2aae8

Browse files
committed
AbstractPPL 0.11; change prefixing behaviour
1 parent 324e623 commit 0e2aae8

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DynamicPPLMooncakeExt = ["Mooncake"]
4444
[compat]
4545
ADTypes = "1"
4646
AbstractMCMC = "5"
47-
AbstractPPL = "0.10.1"
47+
AbstractPPL = "0.11"
4848
Accessors = "0.1"
4949
BangBang = "0.4.1"
5050
Bijectors = "0.13.18, 0.14, 0.15"

src/contexts.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,8 @@ function setchildcontext(::PrefixContext{Prefix}, child) where {Prefix}
260260
return PrefixContext{Prefix}(child)
261261
end
262262

263-
const PREFIX_SEPARATOR = Symbol(".")
264-
265-
@generated function PrefixContext{PrefixOuter}(
266-
context::PrefixContext{PrefixInner}
267-
) where {PrefixOuter,PrefixInner}
268-
return :(PrefixContext{$(QuoteNode(Symbol(PrefixOuter, PREFIX_SEPARATOR, PrefixInner)))}(
269-
context.context
270-
))
271-
end
272-
273263
function prefix(ctx::PrefixContext{Prefix}, vn::VarName{Sym}) where {Prefix,Sym}
274-
vn_prefixed_inner = prefix(childcontext(ctx), vn)
275-
return VarName{Symbol(Prefix, PREFIX_SEPARATOR, getsym(vn_prefixed_inner))}(
276-
getoptic(vn_prefixed_inner)
277-
)
264+
return AbstractPPL.prefix(vn, VarName{Symbol(Prefix)}())
278265
end
279266
prefix(ctx::AbstractContext, vn::VarName) = prefix(NodeTrait(ctx), ctx, vn)
280267
prefix(::IsLeaf, ::AbstractContext, vn::VarName) = vn

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3232
[compat]
3333
ADTypes = "1"
3434
AbstractMCMC = "5"
35-
AbstractPPL = "0.10.1"
35+
AbstractPPL = "0.11"
3636
Accessors = "0.1"
3737
Aqua = "0.8"
3838
Bijectors = "0.15.1"

0 commit comments

Comments
 (0)