Skip to content

Commit fef381f

Browse files
committed
Cleanup
1 parent c5e01cc commit fef381f

File tree

2 files changed

+9
-57
lines changed

2 files changed

+9
-57
lines changed

src/services/DFGVariable.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ getMaxPPE(est::AbstractPointParametricEst) = est.max
99
"$(SIGNATURES)"
1010
getMeanPPE(est::AbstractPointParametricEst) = est.mean
1111
"$(SIGNATURES)"
12-
getSuggestedPPE(est::AbstractPointParametricEst) = est.suggestedisInit
12+
getSuggestedPPE(est::AbstractPointParametricEst) = est.suggested
1313
"$(SIGNATURES)"
1414
getLastUpdatedTimestamp(est::AbstractPointParametricEst) = est.lastUpdatedTimestamp
1515

test/sandbox.jl

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,11 @@
11
using DistributedFactorGraphs
2-
using IncrementalInference
2+
struct TestInferenceVariable1 <: InferenceVariable end
3+
a = DFGVariable(:a, TestInferenceVariable1())
4+
b = copy(a)
35

4-
numNodes = 10
6+
d1 = getSolverData(a)
7+
pop!(solverDataDict(a), :default)
8+
d2 = getSolverData(b)
59

6-
# dfg = LightDFG{SolverParams}()
7-
dfg = GraphsDFG{SolverParams}()
8-
9-
10-
#change ready and solvable for x7,x8 for improved tests on x7x8f1
11-
verts = map(n -> addVariable!(dfg, Symbol("x$n"), ContinuousScalar, labels = [:POSE]), 1:numNodes)
12-
#TODO fix this to use accessors
13-
verts[7].solvable = 1
14-
verts[8].solvable = 0
15-
getSolverData(verts[8]).solveInProgress = 1
16-
setSolvedCount!(verts[1], 5)
17-
#call update to set it on cloud
18-
updateVariable!(dfg, verts[7])
19-
updateVariable!(dfg, verts[8])
20-
21-
# Add some bigData to x1, x2
22-
addBigDataEntry!(verts[1], GeneralBigDataEntry(:testing, :testing; mimeType="application/nuthin!"))
23-
addBigDataEntry!(verts[2], FileBigDataEntry(:testing2, "/dev/null"))
24-
#call update to set it on cloud
25-
updateVariable!(dfg, verts[1])
26-
updateVariable!(dfg, verts[2])
27-
28-
facts = map(n -> addFactor!(dfg, [verts[n], verts[n+1]], LinearConditional(Normal(50.0,2.0))), 1:(numNodes-1))
29-
30-
# Save and load the graph to test.
31-
filename = "/tmp/test123.tar.gz"
32-
saveDFG(dfg, filename)
33-
34-
filename = "/tmp/test123.tar.gz"
35-
copyDfg = DistributedFactorGraphs._getDuplicatedEmptyDFG(dfg)
36-
@info "Going to load $filename"
37-
retDFG = loadDFG("/tmp/test1.tar.gz", Main, copyDfg)
38-
39-
x2 = getVariable(dfg, :x2)
40-
41-
42-
43-
44-
45-
46-
47-
x2ret = getVariable(retDFG, :x2)
48-
setSolvable!(x2ret, 0)
49-
50-
x2 == x2ret
51-
52-
53-
using Test
54-
for var in ls(dfg)
55-
@test getVariable(dfg, var) == getVariable(retDFG, var)
56-
end
57-
for fact in lsf(dfg)
58-
@test getFactor(dfg, fact) == getFactor(retDFG, fact)
59-
end
10+
d1.dims = 6
11+
d2.dims

0 commit comments

Comments
 (0)