Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function presolveChecklist_StateMachine(csmc::CliqStateMachineContainer)

# check if solveKey is available in all variables?
for var in getVariable.(csmc.cliqSubFg, ls(csmc.cliqSubFg))
if !(csmc.solveKey in listSolveKeys(var))
if !(csmc.solveKey in listStates(var))
logCSM(
csmc,
"CSM-0b create empty data for $(getLabel(var)) on solveKey=$(csmc.solveKey)",
Expand All @@ -188,7 +188,7 @@ function presolveChecklist_StateMachine(csmc::CliqStateMachineContainer)
)
#
@info "create vnd solveKey" csmc.solveKey N
@info "also" listSolveKeys(var)
@info "also" listStates(var)
end
end

Expand Down
8 changes: 0 additions & 8 deletions IncrementalInference/src/ExportAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ export CSMHistory,
deepcopyGraph,
deepcopyGraph!,
copyGraph!,
getSolverData,
getTags,

# using either dictionary or cloudgraphs
normalfromstring,
categoricalfromstring,
# extractdistribution,

SolverParams,
getSolvable,
setSolvable!,
Expand Down
4 changes: 2 additions & 2 deletions IncrementalInference/src/services/AnalysisTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function shrinkFactorGraph(fg; upto::Int = 6)
delVars = filter(x -> isSolvable(getVariable(fgs, x)) == 0, ls(fgs))
todel = setdiff(lsf(fgs; solvable = 0), lsf(fgs; solvable = 1))
delFcts = intersect(lsf(fgs), todel)
allMags = filter(x -> :MAGNETOMETER in getTags(getFactor(fgs, x)), lsfPriors(fgs))
allMags = filter(x -> :MAGNETOMETER in listTags(getFactor(fgs, x)), lsfPriors(fgs))
union!(delFcts, filter(x -> length(ls(fgs, x)) == 0, allMags))

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

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

# kyD = [(kys[i],kys[i+1]) for i in 1:length(kys)-1]
Expand Down
2 changes: 1 addition & 1 deletion IncrementalInference/src/services/FactorGraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function setValKDE!(
solveKey::Symbol = :default,
)
#
# @error("TESTING setValKDE! ", solveKey, string(listSolveKeys(v)))
# @error("TESTING setValKDE! ", solveKey, string(listStates(v)))
setValKDE!(getState(v, solveKey), mkd, setinit, Float64.(ipc))
return nothing
end
Expand Down
6 changes: 3 additions & 3 deletions IncrementalInference/src/services/GraphInit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function makeSolverData!(
for vl in varList
v = getVariable(dfg,vl)
varType = getStateKind(v) |> IIF._variableType
vsolveKeys = listSolveKeys(dfg,vl)
vsolveKeys = listStates(dfg,vl)
if solveKey != :parametric && !(solveKey in vsolveKeys)
IIF.setDefaultNodeData!(v, 0, getSolverParams(dfg).N; initialized=false, varType, solveKey) # dodims
count += 1
Expand Down Expand Up @@ -292,7 +292,7 @@ function initVariable!(
)
#
@debug "initVariable! $(getLabel(variable))"
if !(solveKey in listSolveKeys(variable))
if !(solveKey in listStates(variable))
@debug "$(getLabel(variable)) needs new VND solveKey=$(solveKey)"
varType = getStateKind(variable)
setDefaultNodeData!(
Expand Down Expand Up @@ -512,7 +512,7 @@ function initAll!(
vari = getVariable(dfg, sym)
varType = DFG.getStateKind(vari)
# does SolverData exist for this solveKey?
vsolveKeys = listSolveKeys(vari)
vsolveKeys = listStates(vari)
# FIXME, likely some consolidation needed with #1637
if !_parametricInit && !(solveKey in vsolveKeys)
# accept complete defaults for a novel solveKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function _isInitializedOrInitSolveKey(
N::Int = 100,
)
# TODO, this solveKey existence test should probably be removed?
if !(solveKey in listSolveKeys(var))
if !(solveKey in listStates(var))
varType = getStateKind(var)
setDefaultNodeData!(
var,
Expand Down
2 changes: 1 addition & 1 deletion IncrementalInference/test/testCompareVariablesFactors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ field = :varValsAll

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

@test_broken !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false)
@test !compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=false)


##
Expand Down
16 changes: 8 additions & 8 deletions IncrementalInference/test/testSolveKey.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ IIF.setDefaultNodeData!(getVariable(fg, :b), 0, 100; solveKey=:testSolveKey,
#


@test !(:default in listSolveKeys(getVariable(fg, :a)))
@test !(:default in listSolveKeys(getVariable(fg, :b)))
@test !(:default in listStates(getVariable(fg, :a)))
@test !(:default in listStates(getVariable(fg, :b)))

@test (:testSolveKey in listSolveKeys(getVariable(fg, :a)))
@test (:testSolveKey in listSolveKeys(getVariable(fg, :b)))
@test (:testSolveKey in listStates(getVariable(fg, :a)))
@test (:testSolveKey in listStates(getVariable(fg, :b)))


##
Expand All @@ -56,11 +56,11 @@ doautoinit!(fg, :b, solveKey=:testSolveKey)
##


@test !(:default in listSolveKeys(getVariable(fg, :a)))
@test !(:default in listSolveKeys(getVariable(fg, :b)))
@test !(:default in listStates(getVariable(fg, :a)))
@test !(:default in listStates(getVariable(fg, :b)))

@test (:testSolveKey in listSolveKeys(getVariable(fg, :a)))
@test (:testSolveKey in listSolveKeys(getVariable(fg, :b)))
@test (:testSolveKey in listStates(getVariable(fg, :a)))
@test (:testSolveKey in listStates(getVariable(fg, :b)))

end

Expand Down
Loading