@@ -19,7 +19,7 @@ const AbstractParams = AbstractDFGParams
1919abstract type AbstractRelativeMinimize <: RelativeObservation end
2020abstract type AbstractManifoldMinimize <: RelativeObservation end
2121
22- const InferenceVariable = VariableStateType {Any}
22+ const InferenceVariable = StateType {Any}
2323const InferenceType = AbstractPackedObservation
2424
2525const PackedSamplableBelief = PackedBelief
@@ -29,29 +29,26 @@ export setSolverData!
2929# $SIGNATURES
3030# Set solver data structure stored in a variable.
3131# """
32- function setSolverData! (v:: VariableCompute , data:: VariableState , key:: Symbol = :default )
32+ function setSolverData! (v:: VariableCompute , data:: State , key:: Symbol = :default )
3333 Base. depwarn (
34- " setSolverData!(v::VariableCompute, data::VariableState , key::Symbol = :default) is deprecated, use mergeVariableState ! instead." ,
34+ " setSolverData!(v::VariableCompute, data::State , key::Symbol = :default) is deprecated, use mergeState ! instead." ,
3535 :setSolverData! ,
3636 )
37- @assert key == data. solveKey " VariableState .solveKey=:$(data. solveKey) does not match requested :$(key) "
37+ @assert key == data. solveKey " State .solveKey=:$(data. solveKey) does not match requested :$(key) "
3838 return v. solverDataDict[key] = data
3939end
4040
41- @deprecate mergeVariableSolverData! (args... ; kwargs... ) mergeVariableState! (
42- args... ;
43- kwargs... ,
44- )
41+ @deprecate mergeVariableSolverData! (args... ; kwargs... ) mergeState! (args... ; kwargs... )
4542
4643export mergeVariableData!, mergeGraphVariableData!
4744function mergeVariableData! (args... )
4845 return error (
49- " mergeVariableData! is obsolete, use mergeVariableState ! for state, PPEs are obsolete" ,
46+ " mergeVariableData! is obsolete, use mergeState ! for state, PPEs are obsolete" ,
5047 )
5148end
5249function mergeGraphVariableData! (args... )
5350 return error (
54- " mergeGraphVariableData! is obsolete, use mergeVariableState ! for state, PPEs are obsolete" ,
51+ " mergeGraphVariableData! is obsolete, use mergeState ! for state, PPEs are obsolete" ,
5552 )
5653end
5754
@@ -83,7 +80,7 @@ function lsWho(dfg::AbstractDFG, type::Symbol)
8380end
8481
8582# solvekey is deprecated and sync!/copyto! is the better verb.
86- # TODO replace with syncVariableStates ! or similar
83+ # TODO replace with syncStates ! or similar
8784# """
8885# $SIGNATURES
8986# Duplicate a `solveKey`` into a destination from a source.
@@ -102,8 +99,8 @@ function cloneSolveKey!(
10299)
103100 #
104101 for x in labels
105- sd = deepcopy (getVariableState (getVariable (src_dfg, x), src))
106- copytoVariableState ! (dest_dfg, x, dest, sd)
102+ sd = deepcopy (getState (getVariable (src_dfg, x), src))
103+ copytoState ! (dest_dfg, x, dest, sd)
107104 end
108105
109106 return nothing
@@ -151,10 +148,7 @@ function listSolveKeys(
151148 filterSolveKeys:: Union{Regex, Nothing} = nothing ,
152149 skeys = Set {Symbol} (),
153150)
154- Base. depwarn (
155- " listSolveKeys is deprecated, use listVariableStates instead." ,
156- :listSolveKeys ,
157- )
151+ Base. depwarn (" listSolveKeys is deprecated, use listStates instead." , :listSolveKeys )
158152 #
159153 for ky in keys (getSolverDataDict (variable))
160154 push! (skeys, ky)
178172
179173function listSolveKeys (
180174 dfg:: AbstractDFG ,
181- filterVariables:: Union{Type{<:VariableStateType }, Regex, Nothing} = nothing ;
175+ filterVariables:: Union{Type{<:StateType }, Regex, Nothing} = nothing ;
182176 filterSolveKeys:: Union{Regex, Nothing} = nothing ,
183177 tags:: Vector{Symbol} = Symbol[],
184178 solvable:: Int = 0 ,
@@ -208,10 +202,10 @@ export AbstractPackedFactor
208202const AbstractPackedFactor = AbstractPackedObservation
209203
210204export FactorOperationalMemory
211- const FactorOperationalMemory = FactorSolverCache
205+ const FactorOperationalMemory = FactorCache
212206
213207export VariableNodeData
214- const VariableNodeData = VariableState
208+ const VariableNodeData = State
215209
216210@deprecate getNeighborhood (args... ; kwargs... ) listNeighborhood (args... ; kwargs... )
217211@deprecate addBlob! (store:: AbstractBlobstore , blobId:: UUID , data, :: String ) addBlob! (
@@ -277,56 +271,47 @@ const VariableNodeData = VariableState
277271)
278272@deprecate mergeBlobEntries! (args... ; kwargs... ) mergeBlobentries! (args... ; kwargs... )
279273
280- @deprecate getVariableSolverData (args... ; kwargs... ) getVariableState (args... ; kwargs... )
281- @deprecate addVariableSolverData! (args... ; kwargs... ) addVariableState! (args... ; kwargs... )
282- @deprecate deleteVariableSolverData! (args... ; kwargs... ) deleteVariableState! (
283- args... ;
284- kwargs... ,
285- )
286- @deprecate listVariableSolverData (args... ; kwargs... ) listVariableStates (args... ; kwargs... )
287- @deprecate getVariableSolverDataAll (args... ; kwargs... ) getVariableStates (
288- args... ;
289- kwargs... ,
290- )
274+ @deprecate getVariableSolverData (args... ; kwargs... ) getState (args... ; kwargs... )
275+ @deprecate addVariableSolverData! (args... ; kwargs... ) addState! (args... ; kwargs... )
276+ @deprecate deleteVariableSolverData! (args... ; kwargs... ) deleteState! (args... ; kwargs... )
277+ @deprecate listVariableSolverData (args... ; kwargs... ) listStates (args... ; kwargs... )
278+ @deprecate getVariableSolverDataAll (args... ; kwargs... ) getStates (args... ; kwargs... )
291279
292- @deprecate getSolverData (v:: VariableCompute , solveKey:: Symbol = :default ) getVariableState (
280+ @deprecate getSolverData (v:: VariableCompute , solveKey:: Symbol = :default ) getState (
293281 v,
294282 solveKey,
295283)
296284
297- @deprecate packVariableNodeData (args... ; kwargs... ) packVariableState (args... ; kwargs... )
298- @deprecate unpackVariableNodeData (args... ; kwargs... ) unpackVariableState (
299- args... ;
300- kwargs... ,
301- )
285+ @deprecate packVariableNodeData (args... ; kwargs... ) packState (args... ; kwargs... )
286+ @deprecate unpackVariableNodeData (args... ; kwargs... ) unpackState (args... ; kwargs... )
302287
303288export updateVariableSolverData!
304289
305290# TODO possibly completely deprecated or not exported until update verb is standardized
306291function updateVariableSolverData! (
307292 dfg:: AbstractDFG ,
308293 variablekey:: Symbol ,
309- vnd:: VariableState ,
294+ vnd:: State ,
310295 useCopy:: Bool = false ,
311296 fields:: Vector{Symbol} = Symbol[];
312297 warn_if_absent:: Bool = true ,
313298)
314299 Base. depwarn (
315- " updateVariableSolverData! is deprecated, use mergeVariableState ! or copytoVariableState ! instead" ,
300+ " updateVariableSolverData! is deprecated, use mergeState ! or copytoState ! instead" ,
316301 :updateVariableSolverData! ,
317302 )
318303 # This is basically just setSolverData
319304 var = getVariable (dfg, variablekey)
320305 warn_if_absent &&
321306 ! haskey (var. solverDataDict, vnd. solveKey) &&
322- @warn " VariableState '$(vnd. solveKey) ' does not exist, adding"
307+ @warn " State '$(vnd. solveKey) ' does not exist, adding"
323308
324309 # for InMemoryDFGTypes do memory copy or repointing, for cloud this would be an different kind of update.
325310 usevnd = vnd # useCopy ? deepcopy(vnd) : vnd
326311 # should just one, or many pointers be updated?
327312 useExisting =
328313 haskey (var. solverDataDict, vnd. solveKey) &&
329- isa (var. solverDataDict[vnd. solveKey], VariableState ) &&
314+ isa (var. solverDataDict[vnd. solveKey], State ) &&
330315 length (fields) != 0
331316 # @error useExisting vnd.solveKey
332317 if useExisting
353338function updateVariableSolverData! (
354339 dfg:: AbstractDFG ,
355340 variablekey:: Symbol ,
356- vnd:: VariableState ,
341+ vnd:: State ,
357342 solveKey:: Symbol ,
358343 useCopy:: Bool = false ,
359344 fields:: Vector{Symbol} = Symbol[];
@@ -362,7 +347,7 @@ function updateVariableSolverData!(
362347 # TODO not very clean
363348 if vnd. solveKey != solveKey
364349 Base. depwarn (
365- " updateVariableSolverData with solveKey is deprecated use copytoVariableState ! instead." ,
350+ " updateVariableSolverData with solveKey is deprecated use copytoState ! instead." ,
366351 :updateVariableSolverData! ,
367352 )
368353 usevnd = useCopy ? deepcopy (vnd) : vnd
@@ -400,7 +385,7 @@ function updateVariableSolverData!(
400385 # toshow = listSolveKeys(sourceVariable) |> collect
401386 # @info "update DFGVar solveKey" solveKey vnd.solveKey
402387 # @show toshow
403- @assert solveKey == vnd. solveKey " VariableState 's solveKey=:$(vnd. solveKey) does not match requested :$solveKey "
388+ @assert solveKey == vnd. solveKey " State 's solveKey=:$(vnd. solveKey) does not match requested :$solveKey "
404389 return updateVariableSolverData! (
405390 dfg,
406391 sourceVariable. label,
434419
435420# # factor refactor deprecations
436421Base. @kwdef mutable struct GenericFunctionNodeData{
437- T <: Union{<:AbstractPackedObservation, <:AbstractObservation, <:FactorSolverCache } ,
422+ T <: Union{<:AbstractPackedObservation, <:AbstractObservation, <:FactorCache } ,
438423}
439424 eliminated:: Bool = false
440425 potentialused:: Bool = false
@@ -457,7 +442,7 @@ function FactorCompute(
457442 variableOrder:: Union{Vector{Symbol}, Tuple} ;
458443 observation = getFactorType (solverData),
459444 state:: FactorState = FactorState (),
460- solvercache:: Base.RefValue{<:FactorSolverCache } = Ref {FactorSolverCache } (),
445+ solvercache:: Base.RefValue{<:FactorCache } = Ref {FactorCache } (),
461446 id:: Union{UUID, Nothing} = nothing ,
462447 smallData:: Dict{Symbol, SmallDataTypes} = Dict {Symbol, SmallDataTypes} (),
463448)
@@ -512,7 +497,7 @@ function decodePackedType(
512497 varOrder:: AbstractVector{Symbol} ,
513498 :: Type{T} ,
514499 packeddata:: GenericFunctionNodeData{PT} ,
515- ) where {T <: FactorSolverCache , PT}
500+ ) where {T <: FactorCache , PT}
516501 error (" decodePackedType is obsolete" )
517502 #
518503 # TODO , to solve IIF 1424
@@ -552,9 +537,8 @@ function PackedFunctionNodeData(args...; kw...)
552537 return PackedFunctionNodeData {typeof(args[4])} (args... ; kw... )
553538end
554539
555- const FunctionNodeData{T} = GenericFunctionNodeData{
556- T,
557- } where {T <: Union{<:AbstractObservation, <:FactorSolverCache} }
540+ const FunctionNodeData{T} =
541+ GenericFunctionNodeData{T} where {T <: Union{<:AbstractObservation, <:FactorCache} }
558542FunctionNodeData (args... ; kw... ) = FunctionNodeData {typeof(args[4])} (args... ; kw... )
559543
560544# this is the GenericFunctionNodeData for packed types
@@ -587,7 +571,7 @@ function FactorCompute(
587571 solverData. inflation,
588572 )
589573
590- if solverData. fnc isa FactorSolverCache
574+ if solverData. fnc isa FactorCache
591575 solvercache = solverData. fnc
592576 else
593577 solvercache = nothing
@@ -619,22 +603,22 @@ end
619603# TODO make sure getFactorOperationalMemoryType is obsolete
620604function getFactorOperationalMemoryType (dummy)
621605 return error (
622- " Please extend your workspace with function getFactorOperationalMemoryType(<:AbstractParams) for your usecase, e.g. IncrementalInference uses `CommonConvWrapper <: FactorSolverCache `" ,
606+ " Please extend your workspace with function getFactorOperationalMemoryType(<:AbstractParams) for your usecase, e.g. IncrementalInference uses `CommonConvWrapper <: FactorCache `" ,
623607 )
624608end
625609function getFactorOperationalMemoryType (dfg:: AbstractDFG )
626610 return getFactorOperationalMemoryType (getSolverParams (dfg))
627611end
628612
629- function typeModuleName (variableType:: VariableStateType )
613+ function typeModuleName (variableType:: StateType )
630614 Base. depwarn (" typeModuleName is obsolete" , :typeModuleName )
631615 io = IOBuffer ()
632616 ioc = IOContext (io, :module => DistributedFactorGraphs)
633617 show (ioc, typeof (variableType))
634618 return String (take! (io))
635619end
636620
637- typeModuleName (varT:: Type{<:VariableStateType } ) = typeModuleName (varT ())
621+ typeModuleName (varT:: Type{<:StateType } ) = typeModuleName (varT ())
638622
639623# # ================================================================================
640624# # Deprecated in v0.25
0 commit comments