Skip to content

Commit 1206294

Browse files
committed
remove many dep warnings
1 parent 74991a2 commit 1206294

File tree

8 files changed

+86
-69
lines changed

8 files changed

+86
-69
lines changed

src/BigData/entities/AbstractBigDataEntries.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Internal function to generate a unique key for the entry - userId_robotId_sessio
1717
Simple symbol.
1818
"""
1919
function _uniqueKey(dfg::G, v::V, key::Symbol)::Symbol where {G <: AbstractDFG, V <: AbstractDFGVariable}
20-
key = join(String.([dfg.userId, dfg.robotId, dfg.sessionId, label(v), String(key)]), "_")
20+
key = join(String.([dfg.userId, dfg.robotId, dfg.sessionId, getLabel(v), String(key)]), "_")
2121
return Symbol(key)
2222
end
2323

src/CommonAccessors.jl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@ Return the label for a variable or factor.
2020
"""
2121
getLabel(v::DataLevel0) = v.label
2222

23-
"""
24-
$SIGNATURES
25-
26-
Return the label for a variable or factor.
27-
28-
DEPRECATED label -> getLabel
29-
"""
30-
function label(v::DataLevel0)
31-
@warn "Deprecated label, use getLabel instead."
32-
getLabel(v)
33-
end
34-
3523

3624
"""
3725
$SIGNATURES
@@ -41,18 +29,6 @@ Return the tags for a variable.
4129
getTags(v::DataLevel0) = v.tags
4230

4331

44-
"""
45-
$SIGNATURES
46-
47-
Return the tags for a variable.
48-
49-
DEPRECATED, tags -> getTags
50-
"""
51-
function tags(v::DataLevel0)
52-
@warn "tags deprecated, use getTags instead"
53-
getTags(v)
54-
end
55-
5632
"""
5733
$SIGNATURES
5834

src/Deprecated.jl

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,62 @@ function softtype(v::VariableDataLevel1)
7272
@warn "Deprecated softtype, use getSofttype instead."
7373
getSofttype(v)
7474
end
75+
76+
77+
"""
78+
$SIGNATURES
79+
80+
Return the label for a variable or factor.
81+
82+
DEPRECATED label -> getLabel
83+
"""
84+
function label(v::DataLevel0)
85+
@warn "Deprecated label, use getLabel instead."
86+
getLabel(v)
87+
end
88+
89+
90+
"""
91+
$SIGNATURES
92+
93+
Return the tags for a variable.
94+
95+
DEPRECATED, tags -> getTags
96+
"""
97+
function tags(v::DataLevel0)
98+
@warn "tags deprecated, use getTags instead"
99+
getTags(v)
100+
end
101+
102+
103+
"""
104+
$SIGNATURES
105+
106+
Retrieve data structure stored in a variable.
107+
"""
108+
function getData(v::DFGVariable; solveKey::Symbol=:default)::VariableNodeData
109+
@warn "getData is deprecated, please use solverData()"
110+
return v.solverDataDict[solveKey]
111+
end
112+
113+
114+
"""
115+
$SIGNATURES
116+
117+
Set solver data structure stored in a variable.
118+
"""
119+
function setSolverData(v::DFGVariable, data::VariableNodeData, key::Symbol=:default)
120+
@warn "Deprecated setSolverData, use setSolverData! instead."
121+
setSolverData!(v, data, key)
122+
end
123+
124+
125+
"""
126+
$SIGNATURES
127+
128+
Retrieve solver data structure stored in a factor.
129+
"""
130+
function data(f::DFGFactor)::GenericFunctionNodeData
131+
@warn "data() is deprecated, please use solverData()"
132+
return f.data
133+
end

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ include("entities/AbstractDFG.jl")
1515
include("entities/DFGFactor.jl")
1616
include("entities/DFGVariable.jl")
1717
include("entities/AbstractDFGSummary.jl")
18-
include("Deprecated.jl")
1918

2019
export AbstractDFG
2120
export AbstractParams, NoSolverParams
@@ -81,6 +80,7 @@ include("services/AbstractDFG.jl")
8180
include("services/DFGVariable.jl")
8281
include("services/DFGFactor.jl")
8382
include("CommonAccessors.jl")
83+
include("Deprecated.jl")
8484
include("services/CompareUtils.jl")
8585

8686
# Include the Graphs.jl API.

src/entities/DFGFactor.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,7 @@ Retrieve solver data structure stored in a factor.
103103
function solverData(f::F) where F <: DFGFactor
104104
return f.data
105105
end
106-
"""
107-
$SIGNATURES
108106

109-
Retrieve solver data structure stored in a factor.
110-
"""
111-
function data(f::DFGFactor)::GenericFunctionNodeData
112-
@warn "data() is deprecated, please use solverData()"
113-
return f.data
114-
end
115107
"""
116108
$SIGNATURES
117109

src/entities/DFGVariable.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -282,27 +282,14 @@ getSofttype(v::DFGVariableSummary)::Symbol = v.softtypename
282282
Retrieve solver data structure stored in a variable.
283283
"""
284284
solverData(v::DFGVariable, key::Symbol=:default) = haskey(v.solverDataDict, key) ? v.solverDataDict[key] : nothing
285-
"""
286-
$SIGNATURES
287285

288-
Retrieve data structure stored in a variable.
289-
"""
290-
function getData(v::DFGVariable; solveKey::Symbol=:default)::VariableNodeData
291-
@warn "getData is deprecated, please use solverData()"
292-
return v.solverDataDict[solveKey]
293-
end
294-
"""
295-
$SIGNATURES
296286

297-
Set solver data structure stored in a variable.
298-
"""
299-
setSolverData(v::DFGVariable, data::VariableNodeData, key::Symbol=:default) = v.solverDataDict[key] = data
300287
"""
301288
$SIGNATURES
302289
303290
Set solver data structure stored in a variable.
304291
"""
305-
setSolverData!(v::DFGVariable, data::VariableNodeData, key::Symbol=:default) = setSolverData(v, data, key)
292+
setSolverData!(v::DFGVariable, data::VariableNodeData, key::Symbol=:default) = v.solverDataDict[key] = data
306293

307294
"""
308295
$SIGNATURES

test/iifInterfaceTests.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,29 @@ end
149149
@test updateFactor!(dfg, f1Prime) == getFactor(dfg, f1.label)
150150

151151
# Accessors
152-
@test label(v1) == v1.label
153-
@test tags(v1) == v1.tags
152+
@test getLabel(v1) == v1.label
153+
@test getTags(v1) == v1.tags
154154
@test getTimestamp(v1) == v1.timestamp
155-
@test getVariablePPE(v1) == v1.estimateDict
156-
@test DistributedFactorGraphs.estimate(v1, :notfound) == nothing
155+
@test getVariablePPEs(v1) == v1.ppeDict
156+
@test DistributedFactorGraphs.getVariablePPE(v1, :notfound) == nothing
157157
@test solverData(v1) === v1.solverDataDict[:default]
158158
@test getData(v1) === v1.solverDataDict[:default]
159159
@test solverData(v1, :default) === v1.solverDataDict[:default]
160160
@test solverDataDict(v1) == v1.solverDataDict
161161
@test internalId(v1) == v1._internalId
162+
# legacy compat test
163+
@test getVariablePPE(v1) == v1.estimateDict
164+
162165

163-
@test typeof(softtype(v1)) == ContinuousScalar
164-
@test typeof(softtype(v2)) == ContinuousScalar
166+
@test typeof(getSofttype(v1)) == ContinuousScalar
167+
@test typeof(getSofttype(v2)) == ContinuousScalar
165168
@test typeof(getSofttype(v1)) == ContinuousScalar
166169

167-
@test label(f1) == f1.label
168-
@test tags(f1) == f1.tags
170+
@test getLabel(f1) == f1.label
171+
@test getTags(f1) == f1.tags
169172
@test solverData(f1) == f1.data
170173
# Deprecated functions
171-
@test data(f1) == f1.data
174+
@test solverData(f1) == f1.data
172175
@test getData(f1) == f1.data
173176
# Internal function
174177
@test internalId(f1) == f1._internalId
@@ -444,7 +447,7 @@ end
444447
@test getfield(getVariable(dfg, v), field) == getfield(getVariable(summaryGraph, v), field)
445448
else
446449
# Special case to check the symbol softtype is equal to the full softtype.
447-
@test Symbol(typeof(softtype(getVariable(dfg, v)))) == softtype(getVariable(summaryGraph, v))
450+
@test Symbol(typeof(getSofttype(getVariable(dfg, v)))) == getSofttype(getVariable(summaryGraph, v))
448451
end
449452
end
450453
end

test/interfaceTests.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ end
137137
f1 = getFactor(dfg, f1.label)
138138

139139
# Accessors
140-
@test label(v1) == v1.label
141-
@test tags(v1) == v1.tags
140+
@test getLabel(v1) == v1.label
141+
@test getTags(v1) == v1.tags
142142
testTags = [:ha, :ha23]
143143
@test setTags!(v1, testTags) == testTags
144-
@test tags(v1) == testTags
144+
@test getTags(v1) == testTags
145145

146146
@test getTimestamp(v1) == v1.timestamp
147147
testTimestamp = now()
@@ -153,26 +153,26 @@ end
153153
@test setTimestamp!(f1, testTimestamp) == testTimestamp
154154
@test getTimestamp(f1) == f1.timestamp
155155

156-
@test getVariablePPEs(v1) == v1.estimateDict
156+
@test getVariablePPEs(v1) == v1.ppeDict
157157
@test getVariablePPE(v1, :notfound) == nothing
158158
@test solverData(v1) === v1.solverDataDict[:default]
159159
@test getData(v1) === v1.solverDataDict[:default]
160160
@test solverData(v1, :default) === v1.solverDataDict[:default]
161161
@test solverDataDict(v1) == v1.solverDataDict
162162
@test internalId(v1) == v1._internalId
163163

164-
@test softtype(v1) == st1
165-
@test softtype(v2) == st2
164+
@test getSofttype(v1) == st1
165+
@test getSofttype(v2) == st2
166166
@test getSofttype(v1) == st1
167167

168-
@test label(f1) == f1.label
169-
@test tags(f1) == f1.tags
168+
@test getLabel(f1) == f1.label
169+
@test getTags(f1) == f1.tags
170170
@test setTags!(v1, testTags) == testTags
171-
@test tags(v1) == testTags
171+
@test getTags(v1) == testTags
172172

173173
@test solverData(f1) == f1.data
174174
# Deprecated functions
175-
@test data(f1) == f1.data
175+
@test solverData(f1) == f1.data
176176
@test getData(f1) == f1.data
177177
# Internal function
178178
@test internalId(f1) == f1._internalId
@@ -447,7 +447,7 @@ end
447447
@test getfield(getVariable(dfg, v), field) == getfield(getVariable(summaryGraph, v), field)
448448
else
449449
# Special case to check the symbol softtype is equal to the full softtype.
450-
@test Symbol(typeof(softtype(getVariable(dfg, v)))) == softtype(getVariable(summaryGraph, v))
450+
@test Symbol(typeof(getSofttype(getVariable(dfg, v)))) == getSofttype(getVariable(summaryGraph, v))
451451
end
452452
end
453453
end

0 commit comments

Comments
 (0)