Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/annotations/input_arguments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ function post_product_annotations!(
_merge_input_arguments(left_record, right_record),
)
elseif has_left
annotate!(merged, :rule_input_arguments, get_rule_input_arguments(left_ann))
annotate!(
merged, :rule_input_arguments, get_rule_input_arguments(left_ann)
)
elseif has_right
annotate!(merged, :rule_input_arguments, get_rule_input_arguments(right_ann))
annotate!(
merged, :rule_input_arguments, get_rule_input_arguments(right_ann)
)
end
return nothing
end
Expand Down
5 changes: 3 additions & 2 deletions src/helpers/macrohelpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ macro test_inferred(T, expression)
quote
let
local result = Test.@inferred($expression)
if !(ReactiveMP.MacroHelpers.__test_inferred_typeof(result) <:
$T)
if !(
ReactiveMP.MacroHelpers.__test_inferred_typeof(result) <: $T
)
error(
"Result type $(ReactiveMP.MacroHelpers.__test_inferred_typeof(result)) does not match allowed type $T",
)
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/predefined/continuous_transition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ default_meta(::Type{CTMeta}) =
error("ContinuousTransition node requires meta flag explicitly specified")

default_functional_dependencies(::Type{<:ContinuousTransition}) =
RequireMarginalFunctionalDependencies(a = nothing)
RequireMarginalFunctionalDependencies(; a = nothing)

"""
`ctcompanion_matrix` casts a vector `a` into a matrix `A` by means of linearization of the transformation function `f` around the expansion point `a0`.
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/predefined/probit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ProbitMeta(; p = 32) = ProbitMeta(p)
default_meta(::Type{Probit}) = ProbitMeta(32)

default_functional_dependencies(::Type{<:Probit}) =
RequireMessageFunctionalDependencies(in = NormalMeanPrecision(0.0, 100.0))
RequireMessageFunctionalDependencies(; in = NormalMeanPrecision(0.0, 100.0))

@average_energy Probit (
q_out::Union{PointMass, Bernoulli},
Expand Down
36 changes: 30 additions & 6 deletions test/annotations/input_arguments_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,23 @@ end
has_annotation

right_record = RuleInputArgumentsRecord(
RuleInputArgumentsTestUtils.MockMapping(:right), nothing, nothing, :right_result
RuleInputArgumentsTestUtils.MockMapping(:right),
nothing,
nothing,
:right_result,
)

left_ann = AnnotationDict() # empty: represents a clamped/constant message, which never runs a rule
right_ann = AnnotationDict()
annotate!(right_ann, :rule_input_arguments, right_record)

merged = post_product_annotations!(
(InputArgumentsAnnotations(),), left_ann, right_ann, nothing, nothing, nothing
(InputArgumentsAnnotations(),),
left_ann,
right_ann,
nothing,
nothing,
nothing,
)

@test has_annotation(merged, :rule_input_arguments)
Expand All @@ -259,15 +267,23 @@ end
has_annotation

left_record = RuleInputArgumentsRecord(
RuleInputArgumentsTestUtils.MockMapping(:left), nothing, nothing, :left_result
RuleInputArgumentsTestUtils.MockMapping(:left),
nothing,
nothing,
:left_result,
)

left_ann = AnnotationDict()
right_ann = AnnotationDict() # empty: represents a clamped/constant message, which never runs a rule
annotate!(left_ann, :rule_input_arguments, left_record)

merged = post_product_annotations!(
(InputArgumentsAnnotations(),), left_ann, right_ann, nothing, nothing, nothing
(InputArgumentsAnnotations(),),
left_ann,
right_ann,
nothing,
nothing,
nothing,
)

@test has_annotation(merged, :rule_input_arguments)
Expand All @@ -278,13 +294,21 @@ end
RuleInputArgumentsTestUtils
] begin
import ReactiveMP:
AnnotationDict, post_product_annotations!, InputArgumentsAnnotations, has_annotation
AnnotationDict,
post_product_annotations!,
InputArgumentsAnnotations,
has_annotation

left_ann = AnnotationDict()
right_ann = AnnotationDict()

merged = post_product_annotations!(
(InputArgumentsAnnotations(),), left_ann, right_ann, nothing, nothing, nothing
(InputArgumentsAnnotations(),),
left_ann,
right_ann,
nothing,
nothing,
nothing,
)

@test !has_annotation(merged, :rule_input_arguments)
Expand Down