Skip to content

Commit bbb6781

Browse files
authored
Merge pull request #267 from ReactiveBayes/source-code-for-mf
Add source code for MeanField and NoConstraints structures
2 parents 0261b62 + b98230f commit bbb6781

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GraphPPL"
22
uuid = "b3f8163a-e979-4e85-b43e-1f63d8c8b42c"
33
authors = ["Wouter Nuijten <[email protected]>", "Dmitry Bagaev <[email protected]>"]
4-
version = "4.6.0"
4+
version = "4.6.1"
55

66
[deps]
77
BitSetTuples = "0f2f92aa-23a3-4d05-b791-88071d064721"

src/plugins/variational_constraints/variational_constraints.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ See also: [`BetheFactorization`](@ref)
1717
"""
1818
struct MeanField end
1919

20+
source_code(::MeanField) = "MeanField"
21+
2022
struct NoConstraints end
2123

24+
source_code(::NoConstraints) = "NoConstraints"
25+
2226
include("variational_constraints_macro.jl")
2327
include("variational_constraints_engine.jl")
2428

test/plugins/variational_constraints/variational_constraints_tests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,4 +1160,12 @@ end
11601160
@test occursin("q(x, y)", source)
11611161
@test occursin("q(x)", source)
11621162
@test occursin("q(y)", source)
1163+
1164+
mf_constraints = GraphPPL.MeanField()
1165+
source = GraphPPL.source_code(mf_constraints)
1166+
@test occursin("MeanField", source)
1167+
1168+
nc_constraints = GraphPPL.NoConstraints()
1169+
source = GraphPPL.source_code(nc_constraints)
1170+
@test occursin("NoConstraints", source)
11631171
end

0 commit comments

Comments
 (0)