Skip to content

Commit 324de14

Browse files
authored
listSolveKeys -> listStates (#1896)
1 parent d98ce57 commit 324de14

File tree

8 files changed

+18
-26
lines changed

8 files changed

+18
-26
lines changed

IncrementalInference/src/CliqueStateMachine/services/CliqueStateMachine.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function presolveChecklist_StateMachine(csmc::CliqStateMachineContainer)
170170

171171
# check if solveKey is available in all variables?
172172
for var in getVariable.(csmc.cliqSubFg, ls(csmc.cliqSubFg))
173-
if !(csmc.solveKey in listSolveKeys(var))
173+
if !(csmc.solveKey in listStates(var))
174174
logCSM(
175175
csmc,
176176
"CSM-0b create empty data for $(getLabel(var)) on solveKey=$(csmc.solveKey)",
@@ -188,7 +188,7 @@ function presolveChecklist_StateMachine(csmc::CliqStateMachineContainer)
188188
)
189189
#
190190
@info "create vnd solveKey" csmc.solveKey N
191-
@info "also" listSolveKeys(var)
191+
@info "also" listStates(var)
192192
end
193193
end
194194

IncrementalInference/src/ExportAPI.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ export CSMHistory,
109109
deepcopyGraph,
110110
deepcopyGraph!,
111111
copyGraph!,
112-
getSolverData,
113-
getTags,
114-
115-
# using either dictionary or cloudgraphs
116-
normalfromstring,
117-
categoricalfromstring,
118-
# extractdistribution,
119-
120112
SolverParams,
121113
getSolvable,
122114
setSolvable!,

IncrementalInference/src/services/AnalysisTools.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function shrinkFactorGraph(fg; upto::Int = 6)
2121
delVars = filter(x -> isSolvable(getVariable(fgs, x)) == 0, ls(fgs))
2222
todel = setdiff(lsf(fgs; solvable = 0), lsf(fgs; solvable = 1))
2323
delFcts = intersect(lsf(fgs), todel)
24-
allMags = filter(x -> :MAGNETOMETER in getTags(getFactor(fgs, x)), lsfPriors(fgs))
24+
allMags = filter(x -> :MAGNETOMETER in listTags(getFactor(fgs, x)), lsfPriors(fgs))
2525
union!(delFcts, filter(x -> length(ls(fgs, x)) == 0, allMags))
2626

2727
union!(delVars, (ls(fgs, r"x\d") |> sortDFG)[upto:end])
@@ -176,7 +176,7 @@ function mmdSolveKey(
176176
end
177177

178178
# vari = getVariable(fg, :x1)
179-
# kys = filter(x->!(x in [:graphinit;:default]), listSolveKeys(fg) |> collect |>sortDFG)
179+
# kys = filter(x->!(x in [:graphinit;:default]), listStates(fg) |> collect |>sortDFG)
180180
# X1_dist_0 = kys .|> x->mmdSolveKey(vari, :default_0, x)
181181

182182
# kyD = [(kys[i],kys[i+1]) for i in 1:length(kys)-1]

IncrementalInference/src/services/FactorGraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function setValKDE!(
228228
solveKey::Symbol = :default,
229229
)
230230
#
231-
# @error("TESTING setValKDE! ", solveKey, string(listSolveKeys(v)))
231+
# @error("TESTING setValKDE! ", solveKey, string(listStates(v)))
232232
setValKDE!(getState(v, solveKey), mkd, setinit, Float64.(ipc))
233233
return nothing
234234
end

IncrementalInference/src/services/GraphInit.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function makeSolverData!(
2828
for vl in varList
2929
v = getVariable(dfg,vl)
3030
varType = getStateKind(v) |> IIF._variableType
31-
vsolveKeys = listSolveKeys(dfg,vl)
31+
vsolveKeys = listStates(dfg,vl)
3232
if solveKey != :parametric && !(solveKey in vsolveKeys)
3333
IIF.setDefaultNodeData!(v, 0, getSolverParams(dfg).N; initialized=false, varType, solveKey) # dodims
3434
count += 1
@@ -292,7 +292,7 @@ function initVariable!(
292292
)
293293
#
294294
@debug "initVariable! $(getLabel(variable))"
295-
if !(solveKey in listSolveKeys(variable))
295+
if !(solveKey in listStates(variable))
296296
@debug "$(getLabel(variable)) needs new VND solveKey=$(solveKey)"
297297
varType = getStateKind(variable)
298298
setDefaultNodeData!(
@@ -512,7 +512,7 @@ function initAll!(
512512
vari = getVariable(dfg, sym)
513513
varType = DFG.getStateKind(vari)
514514
# does SolverData exist for this solveKey?
515-
vsolveKeys = listSolveKeys(vari)
515+
vsolveKeys = listStates(vari)
516516
# FIXME, likely some consolidation needed with #1637
517517
if !_parametricInit && !(solveKey in vsolveKeys)
518518
# accept complete defaults for a novel solveKey

IncrementalInference/src/services/TreeBasedInitialization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function _isInitializedOrInitSolveKey(
110110
N::Int = 100,
111111
)
112112
# TODO, this solveKey existence test should probably be removed?
113-
if !(solveKey in listSolveKeys(var))
113+
if !(solveKey in listStates(var))
114114
varType = getStateKind(var)
115115
setDefaultNodeData!(
116116
var,

IncrementalInference/test/testCompareVariablesFactors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ field = :varValsAll
8080

8181
@test compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true, skip=[:fullvariables; :varValsAll; :particleidx])
8282

83-
@test_broken !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false)
83+
@test !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false)
8484

8585

8686
##

IncrementalInference/test/testSolveKey.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ IIF.setDefaultNodeData!(getVariable(fg, :b), 0, 100; solveKey=:testSolveKey,
4141
#
4242

4343

44-
@test !(:default in listSolveKeys(getVariable(fg, :a)))
45-
@test !(:default in listSolveKeys(getVariable(fg, :b)))
44+
@test !(:default in listStates(getVariable(fg, :a)))
45+
@test !(:default in listStates(getVariable(fg, :b)))
4646

47-
@test (:testSolveKey in listSolveKeys(getVariable(fg, :a)))
48-
@test (:testSolveKey in listSolveKeys(getVariable(fg, :b)))
47+
@test (:testSolveKey in listStates(getVariable(fg, :a)))
48+
@test (:testSolveKey in listStates(getVariable(fg, :b)))
4949

5050

5151
##
@@ -56,11 +56,11 @@ doautoinit!(fg, :b, solveKey=:testSolveKey)
5656
##
5757

5858

59-
@test !(:default in listSolveKeys(getVariable(fg, :a)))
60-
@test !(:default in listSolveKeys(getVariable(fg, :b)))
59+
@test !(:default in listStates(getVariable(fg, :a)))
60+
@test !(:default in listStates(getVariable(fg, :b)))
6161

62-
@test (:testSolveKey in listSolveKeys(getVariable(fg, :a)))
63-
@test (:testSolveKey in listSolveKeys(getVariable(fg, :b)))
62+
@test (:testSolveKey in listStates(getVariable(fg, :a)))
63+
@test (:testSolveKey in listStates(getVariable(fg, :b)))
6464

6565
end
6666

0 commit comments

Comments
 (0)