11# # ================================================================================
22# # Deprecated in v0.28
33# #=================================================================================
4- export AbstractRelativeMinimize,
5- AbstractManifoldMinimize,
6- AbstractPrior,
7- AbstractRelative,
8- InferenceVariable,
9- InferenceType,
10- PackedSamplableBelief
11-
12- # TODO : maybe just remove these
13- export NoSolverParams
14- const AbstractPrior = PriorObservation
15- const AbstractRelative = RelativeObservation
16- export AbstractParams
17- const AbstractParams = AbstractDFGParams
18-
194abstract type AbstractRelativeMinimize <: RelativeObservation end
205abstract type AbstractManifoldMinimize <: RelativeObservation end
216
7+ const SkeletonDFGVariable = VariableSkeleton
8+ const DFGVariableSummary = VariableSummary
9+ const PackedVariable = VariableDFG
10+ const Variable = VariableDFG
11+ const DFGVariable = VariableCompute
12+ const SkeletonDFGFactor = FactorSkeleton
13+ const DFGFactorSummary = FactorSummary
14+ const DFGFactor = FactorCompute
15+ const PackedFactor = FactorDFG
16+ const Factor = FactorDFG
17+ const SmallDataTypes = MetadataTypes
18+ const AbstractPrior = PriorObservation
19+ const AbstractRelative = RelativeObservation
20+ const AbstractParams = AbstractDFGParams
2221const InferenceVariable = StateType{Any}
2322const InferenceType = AbstractPackedObservation
24-
2523const PackedSamplableBelief = PackedBelief
26-
27- export getVariableState
28- export addVariableState!
29- export mergeVariableState!
30- export deleteVariableState!
31- export listVariableStates
32- export VariableState
33- export VariableStateType
34- export copytoVariableState!
3524const getVariableState = getState
3625const addVariableState! = addState!
3726const mergeVariableState! = mergeState!
@@ -41,7 +30,6 @@ const VariableState = State
4130const VariableStateType = StateType
4231const copytoVariableState! = copytoState!
4332
44- export setSolverData!
4533# """
4634# $SIGNATURES
4735# Set solver data structure stored in a variable.
5745
5846@deprecate mergeVariableSolverData! (args... ; kwargs... ) mergeState! (args... ; kwargs... )
5947
60- export mergeVariableData!, mergeGraphVariableData!
6148function mergeVariableData! (args... )
6249 return error (
6350 " mergeVariableData! is obsolete, use mergeState! for state, PPEs are obsolete" ,
@@ -129,14 +116,11 @@ function cloneSolveKey!(dfg::AbstractDFG, dest::Symbol, src::Symbol; kw...)
129116 return cloneSolveKey! (dfg, dest, dfg, src; kw... )
130117end
131118
132- export getData, addData!, updateData!, deleteData!
133-
134119# TODO not a good function, as it's not complete.
135120# """
136121# $(SIGNATURES)
137122# Convenience function to get all the metadata of a DFG
138123# """
139- # export getDFGInfo
140124function getDFGInfo (dfg:: AbstractDFG )
141125 return (
142126 description = getDescription (dfg),
@@ -148,10 +132,6 @@ function getDFGInfo(dfg::AbstractDFG)
148132 )
149133end
150134
151- export DFGVariable
152- const DFGVariable = VariableCompute
153-
154- export listSolveKeys, listSupersolves
155135# """
156136# $TYPEDSIGNATURES
157137# List all the solvekeys used amongst all variables in the distributed factor graph object.
@@ -207,6 +187,7 @@ function listSolveKeys(
207187
208188 return skeys
209189end
190+
210191const listSupersolves = listSolveKeys
211192
212193# TODO mergeBlobentries! does not fit with merge definition, should probably be updated to copyto or sync.
@@ -354,19 +335,31 @@ function getfirstBlobentry(dfg::AbstractDFG, label::Symbol, key::Regex)
354335 return getfirstBlobentry (dfg, label; labelFilter = contains (key))
355336end
356337
338+ macro defVariable (args... )
339+ return esc (:(DFG. @defStateType $ (args... )))
340+ end
341+
342+ @deprecate getFactorFunction (args... ) getObservation (args... )
343+ @deprecate getFactorType (args... ) getObservation (args... )
344+
345+ # TODO maybe deprecate setMetadata!
346+ function setMetadata! (v:: VariableDFG , metadata:: Dict{Symbol, MetadataTypes} )
347+ return error (" FIXME: Metadata is not currently mutable in a Variable" )
348+ # v.metadata = base64encode(JSON3.write(metadata))
349+ end
350+
351+ function setMetadata! (v:: VariableCompute , metadata:: Dict{Symbol, MetadataTypes} )
352+ v. smallData != = metadata && empty! (v. smallData)
353+ return merge! (v. smallData, metadata)
354+ end
355+
357356# # ================================================================================
358357# # Deprecated in v0.27
359358# #=================================================================================
360- export AbstractFactor
361- const AbstractFactor = AbstractObservation
362359
363- export AbstractPackedFactor
360+ const AbstractFactor = AbstractObservation
364361const AbstractPackedFactor = AbstractPackedObservation
365-
366- export FactorOperationalMemory
367362const FactorOperationalMemory = FactorCache
368-
369- export VariableNodeData
370363const VariableNodeData = State
371364
372365@deprecate getNeighborhood (args... ; kwargs... ) listNeighborhood (args... ; kwargs... )
@@ -442,13 +435,11 @@ const VariableNodeData = State
442435@deprecate getSolverData (v:: VariableCompute , solveKey:: Symbol = :default ) getState (
443436 v,
444437 solveKey,
445- )
438+ ) false
446439
447440@deprecate packVariableNodeData (args... ; kwargs... ) packState (args... ; kwargs... )
448441@deprecate unpackVariableNodeData (args... ; kwargs... ) unpackState (args... ; kwargs... )
449442
450- export updateVariableSolverData!
451-
452443# TODO possibly completely deprecated or not exported until update verb is standardized
453444function updateVariableSolverData! (
454445 dfg:: AbstractDFG ,
@@ -606,7 +597,7 @@ function FactorCompute(
606597 state:: FactorState = FactorState (),
607598 solvercache:: Base.RefValue{<:FactorCache} = Ref {FactorCache} (),
608599 id:: Union{UUID, Nothing} = nothing ,
609- smallData:: Dict{Symbol, SmallDataTypes } = Dict {Symbol, SmallDataTypes } (),
600+ smallData:: Dict{Symbol, MetadataTypes } = Dict {Symbol, MetadataTypes } (),
610601)
611602 error (
612603 " This constructor is deprecated, use FactorCompute(label, variableOrder, solverData; ...) instead" ,
@@ -627,8 +618,6 @@ function FactorCompute(
627618 )
628619end
629620
630- export getSolverData, setSolverData!
631-
632621function getSolverData (f:: FactorCompute )
633622 return error (
634623 " getSolverData(f::FactorCompute) is obsolete, use getFactorState, getObservation, or getCache instead" ,
@@ -644,14 +633,13 @@ end
644633@deprecate unpackFactor (dfg:: AbstractDFG , factor:: FactorDFG ; skipVersionCheck:: Bool = false ) unpackFactor (
645634 factor;
646635 skipVersionCheck,
647- )
636+ ) false
648637
649638@deprecate rebuildFactorMetadata! (args... ; kwargs... ) rebuildFactorCache! (
650639 args... ;
651640 kwargs... ,
652641)
653642
654- export reconstFactorData
655643function reconstFactorData end
656644
657645function decodePackedType (
@@ -672,7 +660,6 @@ function decodePackedType(
672660 return factordata
673661end
674662
675- export _packSolverData
676663function _packSolverData (f:: FactorCompute , fnctype:: AbstractObservation )
677664 #
678665 error (" _packSolverData is deprecated, use seperate packing of observation #TODO" )
@@ -690,8 +677,6 @@ function _packSolverData(f::FactorCompute, fnctype::AbstractObservation)
690677 end
691678end
692679
693- export GenericFunctionNodeData, PackedFunctionNodeData, FunctionNodeData
694-
695680const PackedFunctionNodeData{T} =
696681 GenericFunctionNodeData{T} where {T <: AbstractPackedObservation }
697682function PackedFunctionNodeData (args... ; kw... )
@@ -716,7 +701,7 @@ function FactorCompute(
716701 solvable:: Int = 1 ,
717702 nstime:: Nanosecond = Nanosecond (0 ),
718703 id:: Union{UUID, Nothing} = nothing ,
719- smallData:: Dict{Symbol, SmallDataTypes } = Dict {Symbol, SmallDataTypes } (),
704+ smallData:: Dict{Symbol, MetadataTypes } = Dict {Symbol, MetadataTypes } (),
720705)
721706 Base. depwarn (
722707 " `FactorCompute` constructor with `GenericFunctionNodeData` is deprecated. observation, state, and solvercache should be provided explicitly." ,
@@ -819,7 +804,6 @@ typeModuleName(varT::Type{<:StateType}) = typeModuleName(varT())
819804@deprecate getRobotLabel (dfg) getAgentLabel (dfg)
820805@deprecate getSessionLabel (dfg) getGraphLabel (dfg)
821806
822- export DFGSummary
823807DFGSummary (args) = error (" DFGSummary is deprecated" )
824808@deprecate getSummary (dfg:: AbstractDFG ) getSummaryGraph (dfg)
825809
0 commit comments