Skip to content

Commit

Permalink
Merge pull request #592 from JuliaRobotics/3Q20/544_deprecation_cleanup
Browse files Browse the repository at this point in the history
Deleting v0.10 deprecations
  • Loading branch information
GearsAD authored Aug 12, 2020
2 parents afd4e41 + df89836 commit 211af7c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 89 deletions.
52 changes: 0 additions & 52 deletions src/Deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,6 @@
# deprecation staging area
##==============================================================================


##==============================================================================
## Remove in 0.10
##==============================================================================

# temporary promote with warning
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

export listSolvekeys

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

export InferenceType
export FunctorSingleton, FunctorPairwise, FunctorPairwiseMinimize

abstract type InferenceType end

# These will become AbstractPrior, AbstractRelativeFactor, and AbstractRelativeFactorMinimize in 0.9.
abstract type FunctorSingleton <: FunctorInferenceType end
abstract type FunctorPairwise <: FunctorInferenceType end
abstract type FunctorPairwiseMinimize <: FunctorInferenceType end

# I don't know how to deprecate this, any suggestions?
const AbstractBigDataEntry = AbstractDataEntry

@deprecate GeneralBigDataEntry(args...; kwargs...) GeneralDataEntry(args...; kwargs...)
@deprecate MongodbBigDataEntry(args...) MongodbDataEntry(args...)
@deprecate FileBigDataEntry(args...) FileDataEntry(args...)

# TODO entities/DFGVariable.jl DFGVariableSummary.bigData getproperty and setproperty!
# TODO entities/DFGVariable.jl DFGVariable.bigData getproperty and setproperty!
@deprecate getBigData(args...) getDataBlob(args...)
@deprecate addBigData!(args...) addDataBlob!(args...)
@deprecate updateBigData!(args...) updateDataBlob!(args...)
@deprecate deleteBigData!(args...) deleteDataBlob!(args...)
@deprecate listStoreEntries(args...) listDataBlobs(args...)
@deprecate hasBigDataEntry(args...) hasDataEntry(args...)


@deprecate getBigDataEntry(args...) getDataEntry(args...)
@deprecate addBigDataEntry!(args...) addDataEntry!(args...)
@deprecate updateBigDataEntry!(args...) updateDataEntry!(args...)
@deprecate deleteBigDataEntry!(args...) deleteDataEntry!(args...)
@deprecate getBigDataKeys(args...) listDataEntries(args...)
@deprecate getBigDataEntries(args...) getDataEntries(args...)
@deprecate getDataEntryElement(args...) getDataEntryBlob(args...)


##==============================================================================
## Remove in 0.11
##==============================================================================
Expand Down
4 changes: 0 additions & 4 deletions src/entities/DFGFactor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ end
Base.setproperty!(x::DFGFactor,f::Symbol, val) = begin
if f == :solvable || f == :solverData
getfield(x,f)[] = val
elseif f == :timestamp && val isa DateTime
# #TODO Deprecation - Remove in v0.10
Base.depwarn("DFGFactor timestamp field is now a ZonedTimestamp", :setproperty!)
setfield!(x,:timestamp, ZonedDateTime(val, localzone()))
else
setfield!(x,f,val)
end
Expand Down
31 changes: 0 additions & 31 deletions src/entities/DFGVariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,6 @@ end
Base.getproperty(x::DFGVariable,f::Symbol) = begin
if f == :solvable
getfield(x,f)[]
#TODO Deprecation - Remove in v0.10
elseif f == :bigData
Base.depwarn("DFGVariable field bigData is deprecated, use `dataDict` instead",:getproperty)
getfield(x,:dataDict)
else
getfield(x,f)
end
Expand All @@ -304,14 +300,6 @@ end
Base.setproperty!(x::DFGVariable,f::Symbol, val) = begin
if f == :solvable
getfield(x,f)[] = val
elseif f == :bigData
#TODO Deprecation - Remove in v0.10
Base.depwarn("DFGVariable field bigData is deprecated, use `dataDict` instead", :setproperty!)
setfield(x, :dataDict, val)
elseif f == :timestamp && val isa DateTime
# #TODO Deprecation - Remove in v0.10
Base.depwarn("DFGVariable timestamp field is now a ZonedTimestamp", :setproperty!)
setfield!(x,:timestamp, ZonedDateTime(val, localzone()))
else
setfield!(x,f,val)
end
Expand Down Expand Up @@ -359,25 +347,6 @@ struct DFGVariableSummary <: AbstractDFGVariable
dataDict::Dict{Symbol, AbstractDataEntry}
end

#TODO Deprecation - Remove in v0.10
Base.getproperty(x::DFGVariableSummary,f::Symbol) = begin
if f == :bigData
Base.depwarn("DFGVariableSummary field bigData is deprecated, use `dataDict` instead",:getproperty)
getfield(x,:dataDict)
else
getfield(x,f)
end
end

#TODO Deprecation - Remove in v0.10
Base.setproperty!(x::DFGVariableSummary,f::Symbol, val) = begin
if f == :bigData
Base.depwarn("DFGVariableSummary field bigData is deprecated, use `dataDict` instead",:setproperty!)
setfield(x, :dataDict)
else
setfield!(x,f,val)
end
end
##------------------------------------------------------------------------------
## SkeletonDFGVariable.jl
##------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/services/DFGFactor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Return `::Bool` on whether given factor `fc::Symbol` is a prior in factor graph
"""
function isPrior(dfg::G, fc::Symbol)::Bool where G <: AbstractDFG
fco = getFactor(dfg, fc)
getFactorType(fco) isa AbstractPrior || getFactorType(fco) isa FunctorSingleton
getFactorType(fco) isa AbstractPrior
end


Expand Down
2 changes: 1 addition & 1 deletion test/testBlocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ end
@test lsf(fg) == listFactors(fg)

if getVariable(fg, ls(fg)[1]) isa DFGVariable
@test :default in listSolvekeys(fg)
@test :default in listSolveKeys(fg)
@test :default in listSupersolves(fg)
end

Expand Down

0 comments on commit 211af7c

Please sign in to comment.