@@ -472,22 +472,22 @@ end
472
472
"""
473
473
conditioned(context::AbstractContext)
474
474
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`.
476
476
477
477
Note that this will recursively traverse the context stack and return
478
478
a merged version of the condition values.
479
479
"""
480
480
function conditioned (context:: AbstractContext )
481
481
return conditioned (NodeTrait (conditioned, context), context)
482
482
end
483
- conditioned (:: IsLeaf , context) = Dict {VarName,Any} ()
483
+ conditioned (:: IsLeaf , context) = NamedTuple ()
484
484
conditioned (:: IsParent , context) = conditioned (childcontext (context))
485
485
function conditioned (context:: ConditionContext )
486
486
# Note the order of arguments to `merge`. The behavior of the rest of DPPL
487
487
# is that the outermost `context` takes precendence, hence when resolving
488
488
# the `conditioned` variables we need to ensure that `context.values` takes
489
489
# precedence over decendants of `context`.
490
- return _merge (conditioned (childcontext (context)), to_varname_dict (context . values ))
490
+ return _merge (context . values, conditioned (childcontext (context)))
491
491
end
492
492
function conditioned (context:: PrefixContext )
493
493
return conditioned (collapse_prefix_stack (context))
0 commit comments