Skip to content

Commit 76a6a48

Browse files
committed
put back deprecated for a bit longer and backward compat for loadDFG
1 parent 3435826 commit 76a6a48

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

src/Deprecated.jl

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,57 @@
11
##==============================================================================
22
# deprecation staging area
33
##==============================================================================
4+
##==============================================================================
5+
## Deprecated in v0.9 Remove in the v0.10 cycle
6+
##==============================================================================
7+
8+
# temporary promote with warning
9+
Base.promote_rule(::Type{DateTime}, ::Type{ZonedDateTime}) = DateTime
10+
function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
11+
@warn "DFG now uses ZonedDateTime, temporary promoting and converting to DateTime local time"
12+
return DateTime(ts, Local)
13+
end
14+
15+
@deprecate listSolvekeys(x...) listSolveKeys(x...)
16+
17+
18+
19+
export InferenceType
20+
export FunctorSingleton, FunctorPairwise, FunctorPairwiseMinimize
21+
22+
abstract type InferenceType end
23+
24+
# These will become AbstractPrior, AbstractRelativeFactor, and AbstractRelativeFactorMinimize in 0.9.
25+
abstract type FunctorSingleton <: FunctorInferenceType end
26+
abstract type FunctorPairwise <: FunctorInferenceType end
27+
abstract type FunctorPairwiseMinimize <: FunctorInferenceType end
28+
29+
# I don't know how to deprecate this, any suggestions?
30+
const AbstractBigDataEntry = AbstractDataEntry
31+
32+
@deprecate GeneralBigDataEntry(args...; kwargs...) GeneralDataEntry(args...; kwargs...)
33+
@deprecate MongodbBigDataEntry(args...) MongodbDataEntry(args...)
34+
@deprecate FileBigDataEntry(args...) FileDataEntry(args...)
35+
36+
@deprecate getBigData(args...) getDataBlob(args...)
37+
@deprecate addBigData!(args...) addDataBlob!(args...)
38+
@deprecate updateBigData!(args...) updateDataBlob!(args...)
39+
@deprecate deleteBigData!(args...) deleteDataBlob!(args...)
40+
@deprecate listStoreEntries(args...) listDataBlobs(args...)
41+
@deprecate hasBigDataEntry(args...) hasDataEntry(args...)
42+
43+
@deprecate getBigDataEntry(args...) getDataEntry(args...)
44+
@deprecate addBigDataEntry!(args...) addDataEntry!(args...)
45+
@deprecate updateBigDataEntry!(args...) updateDataEntry!(args...)
46+
@deprecate deleteBigDataEntry!(args...) deleteDataEntry!(args...)
47+
@deprecate getBigDataKeys(args...) listDataEntries(args...)
48+
@deprecate getBigDataEntries(args...) getDataEntries(args...)
49+
@deprecate getDataEntryElement(args...) getDataEntryBlob(args...)
450

551
##==============================================================================
652
## Remove in 0.11
753
##==============================================================================
854

9-
@deprecate listSolvekeys(x...; kwargs...) listSolveKeys(x...;kwargs...)
10-
1155
@deprecate addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solveKey::Symbol) addVariableSolverData!(dfg, variablekey, vnd)
1256

1357
@deprecate updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) updatePPE!(dfg, variablekey, ppe)

src/services/Serialization.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ function unpackVariableNodeData(dfg::G, d::PackedVariableNodeData)::VariableNode
190190

191191
@debug "Dispatching conversion packed variable -> variable for type $(string(d.softtype))"
192192
# Figuring out the softtype
193-
st = getTypeFromSerializationModule(d.softtype)
193+
# TODO deprecated remove in v0.11 - for backward compatibility for saved softtypes.
194+
ststring = string(split(d.softtype, "(")[1])
195+
st = getTypeFromSerializationModule(ststring)
194196
isnothing(st) && error("The variable doesn't seem to have a softtype. It needs to set up with an InferenceVariable from IIF. This will happen if you use DFG to add serialized variables directly and try use them. Please use IncrementalInference.addVariable().")
195197

196198
return VariableNodeData{st}(M3,M4, d.BayesNetOutVertIDs,

0 commit comments

Comments
 (0)