Skip to content

Commit 4d460b9

Browse files
committed
update IIF_TEST subgraph tests
1 parent bc3656d commit 4d460b9

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/services/AbstractDFG.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,15 +954,20 @@ function buildSubgraph(::Type{G},
954954
variableFactorLabels::Vector{Symbol},
955955
distance::Int=0;
956956
solvable::Int=0,
957+
sessionId::String = "",
957958
kwargs...) where G <: AbstractDFG
958959

960+
if sessionId == ""
961+
sessionId = getSessionId(dfg) * "_sub_$(string(uuid4())[1:6])"
962+
end
963+
959964
#build up the neighborhood from variableFactorLabels
960965
allvarfacs = getNeighborhood(dfg, variableFactorLabels, distance; solvable=solvable)
961966

962967
variableLabels = intersect(listVariables(dfg), allvarfacs)
963968
factorLabels = intersect(listFactors(dfg), allvarfacs)
964969
# Copy the section of graph we want
965-
destDFG = deepcopyGraph(G, dfg, variableLabels, factorLabels; kwargs...)
970+
destDFG = deepcopyGraph(G, dfg, variableLabels, factorLabels; sessionId=sessionId, kwargs...)
966971
return destDFG
967972
end
968973

test/CGStructureTests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ f2 = addFactor!(dfg, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
6969
sessions = lsSessions(dfg)
7070
@test map(s -> s.id, sessions) == [session.id]
7171

72-
dfgLocal = GraphsDFG{SolverParams}(params=SolverParams())
73-
DistributedFactorGraphs.getSubgraph(dfg, union(ls(dfg), lsf(dfg)), true, dfgLocal)
72+
dfgLocal = buildSubgraph(LightDFG, dfg, union(ls(dfg), lsf(dfg)))
7473
# Confirm that with sentinels we still have the same graph (doesn't pull in the sentinels)
7574
@test symdiff(ls(dfgLocal), ls(dfg)) == []
7675
@test symdiff(lsf(dfgLocal), lsf(dfg)) == []

test/iifCompareTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ end
8585
addVariable!(fg, :l1, ContinuousScalar)
8686
addFactor!(fg, [:x1;:l1], LinearConditional(Rayleigh()))
8787

88-
sfg = buildSubgraphFromLabels!(fg, [:x0;:x1])
88+
sfg = buildSubgraph(LightDFG, fg, [:x0;:x1])
8989

9090
@warn "FIXME This is NOT supposed to pass"
9191
@test_skip compareFactorGraphs(fg, sfg, skip=[:labelDict;:addHistory;:logpath])

0 commit comments

Comments
 (0)