Skip to content

Commit cb24649

Browse files
authored
Merge pull request #1544 from JuliaRobotics/22Q2/maint/initVariable
initManual! -> initVariable! for deprecation
2 parents af70e56 + f54d5be commit cb24649

11 files changed

+25
-25
lines changed

src/DeconvUtils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function approxDeconv(dfg::AbstractDFG,
154154
lbls = getVariableOrder(fct)
155155
for lb in lbls
156156
exists(tfg, lb) ? nothing : addVariable!(tfg, lb, getVariableType(dfg, lb))
157-
initManual!(tfg, lb, getBelief(dfg, lb, solveKey))
157+
initVariable!(tfg, lb, getBelief(dfg, lb, solveKey))
158158
end
159159

160160
# add factor type requested by user
@@ -216,7 +216,7 @@ function deconvSolveKey(dfg::AbstractDFG,
216216
if !exists(tfg, refSym_)
217217
addVariable!(tfg, refSym_, refVarType)
218218
end
219-
initManual!(tfg, refSym_, Xref)
219+
initVariable!(tfg, refSym_, Xref)
220220

221221
# add the second "test" variable
222222
tstVarType = getVariableType(dfg, tstSym)
@@ -225,7 +225,7 @@ function deconvSolveKey(dfg::AbstractDFG,
225225
if !exists(tfg, tstSym_)
226226
addVariable!(tfg, tstSym_, tstVarType)
227227
end
228-
initManual!(tfg, tstSym_, Xtst)
228+
initVariable!(tfg, tstSym_, Xtst)
229229

230230
# add the new dummy factor with default manifold for computations
231231
fctType = selectFactorType(refVarType, tstVarType)

src/SolverUtilities.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function _buildGraphByFactorAndTypes!(fct::AbstractFactor,
150150
exists(dfg, vars[s_]) ? nothing : addVariable!(dfg, vars[s_], vTyp)
151151
# set the numerical values if available
152152
# TODO allow pts to come in as full MKD beliefs, not just one point
153-
((0 < length(pts)) && (pts[s_] isa Nothing)) ? nothing : initManual!(dfg, vars[s_], [pts[s_],], solveKey, bw=ones(getDimension(vTyp)))
153+
((0 < length(pts)) && (pts[s_] isa Nothing)) ? nothing : initVariable!(dfg, vars[s_], [pts[s_],], solveKey, bw=ones(getDimension(vTyp)))
154154
end
155155
# if newFactor then add the factor on vars, else assume only one existing factor between vars
156156
_dfgfct = newFactor ? addFactor!(dfg, vars, fct, graphinit=graphinit, _blockRecursion=_blockRecursion) : getFactor(dfg, intersect((ls.(dfg, vars))...)[1] )

src/TreeMessageUtils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function addLikelihoodsDifferential!( msgs::LikelihoodMessage,
226226
# addVariable!(tfg, label, val.variableType)
227227
# @debug "New variable added to subfg" _group=:check_addLHDiff #TODO JT remove debug.
228228
# end
229-
# initManual!(tfg, label, manikde!(val))
229+
# initVariable!(tfg, label, manikde!(val))
230230
# end
231231

232232
# # list all variables in order of dimension size
@@ -275,7 +275,7 @@ function addLikelihoodsDifferentialCHILD!(cliqSubFG::AbstractDFG,
275275
addVariable!(tfg, label, getVariableType(cliqSubFG, label))
276276
@debug "New variable added to subfg" _group=:check_addLHDiff #TODO JT remove debug.
277277
end
278-
initManual!(tfg, label, getBelief(cliqSubFG, label, solveKey), solveKey)
278+
initVariable!(tfg, label, getBelief(cliqSubFG, label, solveKey), solveKey)
279279
end
280280

281281
# list all variables in order of dimension size

src/services/ApproxConv.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function approxConvBelief(dfg::AbstractDFG,
118118
getPoints(pts1Bel)
119119
end
120120
# didn't return early so shift focus to using `tfg` more intensely
121-
initManual!(tfg, varLbls[1], pts)
121+
initVariable!(tfg, varLbls[1], pts)
122122
# use in combination with setPPE and setPPEmethod keyword arguments
123123
ppemethod = setPPEmethod === nothing ? MeanMaxPPE : setPPEmethod
124124
!setPPE ? nothing : setPPE!(tfg, varLbls[1], solveKey, ppemethod)
@@ -130,7 +130,7 @@ function approxConvBelief(dfg::AbstractDFG,
130130
fct = getFactor(dfg, path[idx])
131131
addFactor!(tfg, fct)
132132
ptsBel = approxConvBelief(tfg, fct, path[idx+1]; solveKey, N, skipSolve)
133-
initManual!(tfg, path[idx+1], ptsBel)
133+
initVariable!(tfg, path[idx+1], ptsBel)
134134
!setPPE ? nothing : setPPE!(tfg, path[idx+1], solveKey, ppemethod)
135135
end
136136
end

src/services/GraphInit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Development Notes
1414
1515
Related
1616
17-
doautoinit!, initManual!, isInitialized, isMultihypo
17+
doautoinit!, initVariable!, isInitialized, isMultihypo
1818
"""
1919
function factorCanInitFromOtherVars(dfg::AbstractDFG,
2020
fct::Symbol,

test/testBasicForwardConvolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function forwardConvolve(X0::AbstractVector{P}, model) where P
1818
fg = initfg()
1919

2020
addVariable!(fg, :x0, ContinuousScalar)
21-
initManual!(fg, :x0, X0)
21+
initVariable!(fg, :x0, X0)
2222
addVariable!(fg, :x1, ContinuousScalar)
2323

2424
addFactor!(fg, [:x0;:x1], model)

test/testDERelative.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for i in 1:3
5656
problemType=ODEProblem )
5757
#
5858
addFactor!( fg, [prev;nextSym], oder, graphinit=false )
59-
initManual!(fg, nextSym, [zeros(1) for _ in 1:100])
59+
initVariable!(fg, nextSym, [zeros(1) for _ in 1:100])
6060

6161
prev = nextSym
6262
end
@@ -121,7 +121,7 @@ sl = DifferentialEquations.solve(oder_.forwardProblem)
121121

122122
tfg = initfg()
123123
pts_ = approxConv(fg, :x0f1, :x3, setPPE=true, tfg=tfg)
124-
# initManual!(tfg, :x3, pts)
124+
# initVariable!(tfg, :x3, pts)
125125

126126

127127
##
@@ -242,11 +242,11 @@ pts_ = approxConv(fg, :x0x1f1, :x0)
242242

243243
tfg = initfg()
244244
for s in ls(fg)
245-
initManual!(fg, s, [zeros(2) for _ in 1:100])
245+
initVariable!(fg, s, [zeros(2) for _ in 1:100])
246246
end
247247

248248
pts = approxConv(fg, :x0f1, :x7, setPPE=true, tfg=tfg)
249-
# initManual!(tfg, :x7, pts)
249+
# initVariable!(tfg, :x7, pts)
250250

251251

252252

@@ -416,7 +416,7 @@ pts_ = approxConv(fg, :x0x1ωβf1, :x0)
416416

417417
tfg = initfg()
418418
for s in ls(fg)
419-
initManual!(fg, s, [zeros(2) for _ in 1:100])
419+
initVariable!(fg, s, [zeros(2) for _ in 1:100])
420420
end
421421

422422
# must initialize the parameters

test/testEuclidDistance.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ N=100
112112
points = [[100.0;0.0],[0.0;100.0]]
113113
fg = IIF.generateGraph_EuclidDistance(points)
114114

115-
# initManual!(fg, :l1, [1000.0.*randn(2) for _ in 1:100])
115+
# initVariable!(fg, :l1, [1000.0.*randn(2) for _ in 1:100])
116116

117117
# check regular full solution produces two modes
118118

@@ -275,6 +275,6 @@ end
275275

276276
##
277277

278-
# initManual!(sfg, :l1, pts)
278+
# initVariable!(sfg, :l1, pts)
279279
# pts = approxConv(sfg, :x2l1f1, :l1)
280280
# plotKDE(manikde!(ContinuousEuclid{2}, pts))

test/testMultimodal1D.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@ end
149149
#
150150
#
151151
# stuff = localProduct(fg,:lm2)
152-
# initManual!(fg,:lm2, stuff[1]); p1 = plotKDE(stuff[1], title="lm2")
152+
# initVariable!(fg,:lm2, stuff[1]); p1 = plotKDE(stuff[1], title="lm2")
153153
#
154154
# stuff = localProduct(fg,:lm1)
155-
# initManual!(fg,:lm1, stuff[1]); p2 = plotKDE(stuff[1], title="lm1")
155+
# initVariable!(fg,:lm1, stuff[1]); p2 = plotKDE(stuff[1], title="lm1")
156156
#
157157
# stuff = localProduct(fg,:lp2)
158-
# initManual!(fg,:lp2, stuff[1]); p3 = plotKDE(stuff[1], title="lp2")
158+
# initVariable!(fg,:lp2, stuff[1]); p3 = plotKDE(stuff[1], title="lp2")
159159
#
160160
# stuff = localProduct(fg,:lp1)
161-
# initManual!(fg,:lp1, stuff[1]); p4 = plotKDE(stuff[1], title="lp1")
161+
# initVariable!(fg,:lp1, stuff[1]); p4 = plotKDE(stuff[1], title="lp1")
162162
#
163163
# stuff = localProduct(fg,:x1)
164-
# initManual!(fg,:x1, stuff[1]); p5 = plotKDE(stuff[1], title="x1")
164+
# initVariable!(fg,:x1, stuff[1]); p5 = plotKDE(stuff[1], title="x1")
165165
#
166166
# h1 = hstack(p1,p2,p3,p4,p5)
167167
#

test/testProductReproducable.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ for i in 1:10
7070
pts = approxConv(fg, :abf1, :b)
7171
B_ = manikde!(ContinuousScalar, pts)
7272
# plotKDE([B_; B])
73-
initManual!(fg, :b, B_)
73+
initVariable!(fg, :b, B_)
7474

7575
pts = approxConv(fg, :abf1, :a)
7676
A_ = manikde!(ContinuousScalar, pts)
7777
# plotKDE([A_; A])
78-
initManual!(fg, :a, A_)
78+
initVariable!(fg, :a, A_)
7979
end
8080

8181
A_ = getBelief(fg, :a)

0 commit comments

Comments
 (0)