Skip to content

Commit 787f016

Browse files
committed
update deprecations
1 parent 6c5e3aa commit 787f016

File tree

6 files changed

+24
-135
lines changed

6 files changed

+24
-135
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ end
978978

979979
export SkeletonDFG
980980
function SkeletonDFG(cfg::CloudGraphsDFG)
981-
sfg = DefaultDFG{NoSolverParams, SkeletonDFGVariable, SkeletonDFGFactor}()
981+
sfg = LocalDFG{NoSolverParams, SkeletonDFGVariable, SkeletonDFGFactor}()
982982
addVariable!.(sfg, _getSkeletonVariables(cfg))
983983
addFactor!.(sfg, _getSkeletonFactors(cfg))
984984
return sfg

src/Deprecated.jl

Lines changed: 14 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,14 @@
1-
##==============================================================================
2-
# deprecation staging area
3-
##==============================================================================
4-
##==============================================================================
5-
## Deprecated in v0.9 Remove in the v0.10 cycle
6-
##==============================================================================
7-
8-
@deprecate listSolvekeys(x...) listSolveKeys(x...)
9-
10-
##==============================================================================
11-
## Deprecated in v0.10 Remove in 0.11
12-
##==============================================================================
13-
14-
@deprecate getMaxPPE(est::AbstractPointParametricEst) getPPEMax(est)
15-
@deprecate getMeanPPE(est::AbstractPointParametricEst) getPPEMean(est)
16-
@deprecate getSuggestedPPE(est::AbstractPointParametricEst) getPPESuggested(est)
17-
18-
@deprecate addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solveKey::Symbol) addVariableSolverData!(dfg, variablekey, vnd)
19-
20-
@deprecate updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) updatePPE!(dfg, variablekey, ppe)
21-
22-
@deprecate addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) addPPE!(dfg, variablekey, ppe)
23-
24-
25-
export AbstractDataStore
26-
abstract type AbstractDataStore end
27-
struct GeneralDataEntry <: AbstractDataEntry end
28-
GeneralDataEntry(args...; kwargs...) = error("`GeneralDataEntry` is deprecated, use `BlobStoreEntry`")
29-
30-
export InMemoryDataStore, FileDataStore
31-
32-
struct FileDataStore <: AbstractDataStore end
33-
FileDataStore(args...; kwargs...) = error("`FileDataStore` is deprecated, use `FolderStore`")
34-
35-
struct InMemoryDataStore <: AbstractDataStore end
36-
InMemoryDataStore(args...; kwargs...) = error("`InMemoryDataStore` is deprecated, use TBD")#TODO
37-
38-
_uniqueKey(dfg::AbstractDFG, v::AbstractDFGVariable, key::Symbol)::Symbol = error("_uniqueKey is deprecated")
39-
40-
getDataBlob(store::AbstractDataStore, entry::AbstractDataEntry) = error("AbstractDataStore $(typeof(store)) is deprecated.")
41-
addDataBlob!(store::AbstractDataStore, entry::AbstractDataEntry, data) = error("AbstractDataStore $(typeof(store)) is deprecated.")
42-
updateDataBlob!(store::AbstractDataStore, entry::AbstractDataEntry, data) = error("AbstractDataStore $(typeof(store)) is deprecated.")
43-
deleteDataBlob!(store::AbstractDataStore, entry::AbstractDataEntry) = error("AbstractDataStore $(typeof(store)) is deprecated.")
44-
listDataBlobs(store::AbstractDataStore) = error("AbstractDataStore $(typeof(store)) is deprecated.")
45-
46-
47-
addData!(dfg::AbstractDFG,
48-
lbl::Symbol,
49-
datastore::Union{FileDataStore, InMemoryDataStore},
50-
descr::Symbol,
51-
mimeType::AbstractString,
52-
data::Vector{UInt8} ) = error("This API, FileDataStore and in MemoryDataStore is deprecated use new api parameter order and FolderStore")
53-
54-
export addDataElement!
55-
addDataElement!(dfg::AbstractDFG,
56-
lbl::Symbol,
57-
datastore::Union{FileDataStore, InMemoryDataStore},
58-
descr::Symbol,
59-
mimeType::AbstractString,
60-
data::Vector{UInt8} ) = error("This API, FileDataStore and in MemoryDataStore is deprecated use addData! and FolderStore")
61-
62-
63-
64-
export getDataEntryBlob
65-
getDataEntryBlob(dfg::AbstractDFG,
66-
dfglabel::Symbol,
67-
datastore::Union{FileDataStore, InMemoryDataStore},
68-
datalabel::Symbol) = error("This API, FileDataStore and in MemoryDataStore is deprecated use getData and FolderStore")
69-
70-
export fetchDataEntryElement
71-
const fetchDataEntryElement = getDataEntryBlob
72-
export fetchData
73-
const fetchData = getDataEntryBlob
74-
75-
#
76-
77-
## softtype deprections
78-
function Base.getproperty(x::InferenceVariable, f::Symbol)
79-
if f==:dims
80-
Base.depwarn("varType $(typeof(x)), field dims is deprecated, extend and use `getDimension` instead",:getproperty)
81-
elseif f==:manifolds
82-
Base.depwarn("varType $(typeof(x)), field manifolds is deprecated, extend and use `getManifold` instead",:getproperty)
83-
else
84-
if !(@isdefined softtypeFieldsWarnOnce)
85-
Base.depwarn("varType $(typeof(x)), will be required to be a singleton type in the future and can no longer have fields. *.$f called. Further warnings are suppressed",:getproperty)
86-
global softtypeFieldsWarnOnce = true
87-
end
88-
end
89-
return getfield(x,f)
90-
end
91-
92-
93-
94-
# SmallData is now a Symbol Dict
95-
function createSymbolDict(d::Dict{String, String})
96-
newsmalld = Dict{Symbol,SmallDataTypes}()
97-
for p in pairs(d)
98-
push!(newsmalld, Symbol(p.first) => p.second)
99-
end
100-
return newsmalld
101-
end
1+
## ================================================================================
2+
## LEGACY ON TIMESTAMPS, TODO DEPRECATE
3+
##=================================================================================
1024

103-
@deprecate setSmallData!(v::DFGVariable, smallData::Dict{String, String}) setSmallData!(v, createSymbolDict(smallData))
104-
105-
#update deprecation with warn_if_absent
106-
function updateVariableSolverData!(dfg::AbstractDFG,
107-
variablekey::Symbol,
108-
vnd::VariableNodeData,
109-
useCopy::Bool,
110-
fields::Vector{Symbol},
111-
verbose::Bool)
112-
Base.depwarn("updateVariableSolverData! argument verbose is deprecated in favor of keyword argument `warn_if_absent`, see #643", :updateVariableSolverData!)
113-
updateVariableSolverData!(dfg, variablekey, vnd, useCopy, fields; warn_if_absent = verbose)
114-
end
1155

116-
function updateVariableSolverData!(dfg::AbstractDFG,
117-
variablekey::Symbol,
118-
vnd::VariableNodeData,
119-
solveKey::Symbol,
120-
useCopy::Bool,
121-
fields::Vector{Symbol},
122-
verbose::Bool)
123-
Base.depwarn("updateVariableSolverData! argument verbose is deprecated in favor of keyword argument `warn_if_absent`, see #643", :updateVariableSolverData!)
124-
updateVariableSolverData!(dfg, variablekey, vnd, solveKey, useCopy, fields; warn_if_absent = verbose)
6+
Base.promote_rule(::Type{DateTime}, ::Type{ZonedDateTime}) = DateTime
7+
function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
8+
@warn "DFG now uses ZonedDateTime, temporary promoting and converting to DateTime local time"
9+
return DateTime(ts, Local)
12510
end
12611

127-
128-
12912
## ================================================================================
13013
## Deprecate before v0.17
13114
##=================================================================================
@@ -205,10 +88,12 @@ end
20588
const FunctorInferenceType = AbstractFactor # will eventually deprecate
20689
const PackedInferenceType = AbstractPackedFactor # will eventually deprecate
20790

208-
Base.promote_rule(::Type{DateTime}, ::Type{ZonedDateTime}) = DateTime
209-
function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
210-
@warn "DFG now uses ZonedDateTime, temporary promoting and converting to DateTime local time"
211-
return DateTime(ts, Local)
212-
end
91+
## ================================================================================
92+
## Deprecate before v0.20
93+
##=================================================================================
94+
95+
export DefaultDFG
96+
97+
const DefaultDFG = LightDFG
21398

21499
#

src/DistributedFactorGraphs.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export updateUserData!, updateRobotData!, updateSessionData!, deleteUserData!, d
7272
export emptyUserData!, emptyRobotData!, emptySessionData!
7373

7474
# Graph Types: exported from modules or @reexport
75-
export InMemoryDFGTypes, DefaultDFG
75+
export InMemoryDFGTypes, LocalDFG
7676

7777
# AbstractDFG Interface
7878
export exists,
@@ -297,9 +297,10 @@ include("GraphsDFG/GraphsDFG.jl")
297297

298298
include("LightDFG/LightDFG.jl")
299299
@reexport using .LightDFGs
300+
300301
#supported in Memory fg types
301302
const InMemoryDFGTypes = Union{GraphsDFG, LightDFG}
302-
const DefaultDFG = LightDFG
303+
const LocalDFG = GraphsDFG
303304

304305
# Common includes
305306
include("services/CommonAccessors.jl")

src/services/AbstractDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ function buildSubgraph(dfg::AbstractDFG,
11981198
variableFactorLabels::Vector{Symbol},
11991199
distance::Int=0;
12001200
kwargs...)
1201-
return buildSubgraph(DefaultDFG, dfg, variableFactorLabels, distance; kwargs...)
1201+
return buildSubgraph(LocalDFG, dfg, variableFactorLabels, distance; kwargs...)
12021202
end
12031203

12041204
"""

src/services/DFGVariable.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ addPPE!(dfg::AbstractDFG, sourceVariable::DFGVariable, ppekey::Symbol=:default)
812812
"""
813813
$(SIGNATURES)
814814
Update PPE data if it exists, otherwise add it -- one call per `key::Symbol=:default`.
815+
816+
Notes
817+
- uses `ppe.solveKey` as solveKey.
815818
"""
816819
function updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst; warn_if_absent::Bool=true)
817820
var = getVariable(dfg, variablekey)

test/testBlocks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,9 @@ function PPETestBlock!(fg, v1)
642642
# Delete it
643643
@test deletePPE!(fg, :a, :default) == ppe
644644
# Update add it
645-
updatePPE!(fg, :a, ppe, :default)
645+
updatePPE!(fg, :a, ppe) #, :default)
646646
# Update update it
647-
updatePPE!(fg, :a, ppe, :default)
647+
updatePPE!(fg, :a, ppe) #, :default)
648648

649649
v1.ppeDict[:default] = deepcopy(ppe)
650650
# Bulk copy PPE's for x0 and x1

0 commit comments

Comments
 (0)