Skip to content

Commit b6a2b46

Browse files
committed
test mergeGraph! and bump to 0.7.3
1 parent 04379ce commit b6a2b46

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.7.2"
3+
version = "0.7.3"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/services/AbstractDFG.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,8 @@ function mergeGraph!(destDFG::AbstractDFG,
974974
# find neighbors at distance to add
975975
allvarfacs = getNeighborhood(sourceDFG, union(variableLabels, factorLabels), distance; solvable=solvable)
976976

977-
sourceVariables = map(vId->getVariable(sourceDFG, vId), intersect(listVariables(sourceDFG), variableFactorLabels))
978-
sourceFactors = map(fId->getFactor(sourceDFG, fId), intersect(listFactors(sourceDFG), variableFactorLabels))
977+
sourceVariables = intersect(listVariables(sourceDFG), allvarfacs)
978+
sourceFactors = intersect(listFactors(sourceDFG), allvarfacs)
979979

980980
copyGraph!(destDFG, sourceDFG, sourceVariables, sourceFactors; deepcopyNodes=true, overwriteDest=true, kwargs...)
981981

test/testBlocks.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,17 @@ function CopyFunctionsTest(testDFGAPI; kwargs...)
11821182

11831183
deepcopyGraph!(dcdfg_part, dfg, Symbol[], [:x1x2f1]; overwriteDest=true)
11841184

1185+
vlbls1 = [:x1, :x2, :x3]
1186+
vlbls2 = [:x4, :x5, :x6]
1187+
dcdfg_part1 = deepcopyGraph(LightDFG, dfg, vlbls1)
1188+
dcdfg_part2 = deepcopyGraph(GraphsDFG, dfg, vlbls2)
11851189

1190+
mergedGraph = testDFGAPI()
1191+
mergeGraph!(mergedGraph, dcdfg_part1)
1192+
mergeGraph!(mergedGraph, dcdfg_part2)
1193+
1194+
@test issetequal(ls(mergedGraph), union(vlbls1, vlbls2))
1195+
@test issetequal(lsf(mergedGraph), union(lsf(dcdfg_part1), lsf(dcdfg_part2)))
11861196
# convert to...
11871197
# condfg = convert(GraphsDFG, dfg)
11881198
# @test condfg isa GraphsDFG

0 commit comments

Comments
 (0)