Skip to content

Commit 919cb25

Browse files
committed
revert conditioned bugfix (will merge this to main instead)
1 parent a85f28d commit 919cb25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/contexts.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,22 +472,22 @@ end
472472
"""
473473
conditioned(context::AbstractContext)
474474
475-
Return a `Dict{VarName,Any}` of the values that are conditioned on under `context`.
475+
Return `NamedTuple` of values that are conditioned on under context`.
476476
477477
Note that this will recursively traverse the context stack and return
478478
a merged version of the condition values.
479479
"""
480480
function conditioned(context::AbstractContext)
481481
return conditioned(NodeTrait(conditioned, context), context)
482482
end
483-
conditioned(::IsLeaf, context) = Dict{VarName,Any}()
483+
conditioned(::IsLeaf, context) = NamedTuple()
484484
conditioned(::IsParent, context) = conditioned(childcontext(context))
485485
function conditioned(context::ConditionContext)
486486
# Note the order of arguments to `merge`. The behavior of the rest of DPPL
487487
# is that the outermost `context` takes precendence, hence when resolving
488488
# the `conditioned` variables we need to ensure that `context.values` takes
489489
# precedence over decendants of `context`.
490-
return _merge(conditioned(childcontext(context)), to_varname_dict(context.values))
490+
return _merge(context.values, conditioned(childcontext(context)))
491491
end
492492
function conditioned(context::PrefixContext)
493493
return conditioned(collapse_prefix_stack(context))

0 commit comments

Comments
 (0)