Skip to content

Commit

Permalink
Merge pull request #620 from JuliaRobotics/depr/20Q3/leave_depr_longer
Browse files Browse the repository at this point in the history
Put back some deprecated for a bit longer and backward compat for loadDFG
  • Loading branch information
Affie authored Aug 16, 2020
2 parents ff27aa4 + d5df251 commit ff56034
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/Deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
##==============================================================================
# deprecation staging area
##==============================================================================

##==============================================================================
## Remove in 0.11
## Deprecated in v0.9 Remove in the v0.10 cycle
##==============================================================================

@deprecate listSolvekeys(x...; kwargs...) listSolveKeys(x...;kwargs...)
Base.promote_rule(::Type{DateTime}, ::Type{ZonedDateTime}) = DateTime
function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
@warn "DFG now uses ZonedDateTime, temporary promoting and converting to DateTime local time"
return DateTime(ts, Local)
end

@deprecate listSolvekeys(x...) listSolveKeys(x...)

##==============================================================================
## Deprecated in v0.10 Remove in 0.11
##==============================================================================

@deprecate addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solveKey::Symbol) addVariableSolverData!(dfg, variablekey, vnd)

Expand Down
4 changes: 3 additions & 1 deletion src/services/Serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ function unpackVariableNodeData(dfg::G, d::PackedVariableNodeData)::VariableNode

@debug "Dispatching conversion packed variable -> variable for type $(string(d.softtype))"
# Figuring out the softtype
st = getTypeFromSerializationModule(d.softtype)
# TODO deprecated remove in v0.11 - for backward compatibility for saved softtypes.
ststring = string(split(d.softtype, "(")[1])
st = getTypeFromSerializationModule(ststring)
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().")

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

0 comments on commit ff56034

Please sign in to comment.