Skip to content

Commit f833298

Browse files
authored
Merge pull request #258 from JuliaRobotics/maint/1Q20/esttoppe
estimateDict -> ppeDict and deprecation warns
2 parents 5ad243d + cfc2fe6 commit f833298

File tree

14 files changed

+232
-164
lines changed

14 files changed

+232
-164
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ dist: trusty
55
os:
66
- linux
77

8+
arch:
9+
- amd64
10+
- arm64
11+
812
services:
913
- neo4j
1014

1115
julia:
1216
- 1.0
13-
- 1.1
1417
- 1.2
1518
- 1.3
1619
- nightly
@@ -24,7 +27,7 @@ jobs:
2427
env: IIF_TEST=true
2528
if: NOT branch =~ ^release.*$
2629
- stage: "Documentation"
27-
julia: 1.0
30+
julia: 1.2
2831
os: linux
2932
script:
3033
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
@@ -38,6 +41,7 @@ notifications:
3841
matrix:
3942
allow_failures:
4043
- julia: nightly
44+
- arch: arm64
4145
# - env: IIF_TEST=true
4246

4347
# Set the password for Neo4j to neo4j:test

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/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ function mergeUpdateVariableSolverData!(dfg::CloudGraphsDFG, sourceVariable::DFG
256256
error("Source variable '$(sourceVariable.label)' doesn't exist in the graph.")
257257
end
258258
var = getVariable(dfg, sourceVariable.label)
259-
newEsts = merge!(var.estimateDict, deepcopy(sourceVariable.estimateDict))
259+
newEsts = merge!(var.ppeDict, deepcopy(sourceVariable.ppeDict))
260260
newSolveData = merge!(var.solverDataDict, sourceVariable.solverDataDict)
261-
Neo4j.setnodeproperty(dfg.neo4jInstance.graph, var._internalId, "estimateDict",
261+
Neo4j.setnodeproperty(dfg.neo4jInstance.graph, var._internalId, "ppeDict",
262262
JSON2.write(newEsts))
263263
Neo4j.setnodeproperty(dfg.neo4jInstance.graph, var._internalId, "solverDataDict",
264264
JSON2.write(Dict(keys(newSolveData) .=> map(vnd -> pack(dfg, vnd), values(newSolveData)))))

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: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# deprecation staging area
2+
3+
## quick deprecation handle
4+
import Base: propertynames, getproperty
5+
6+
Base.propertynames(x::VariableDataLevel1, private::Bool=false) = private ? (:estimateDict, :ppeDict) : (:ppeDict,)
7+
8+
Base.getproperty(x::VariableDataLevel1,f::Symbol) = begin
9+
if f == :estimateDict
10+
@warn "estimateDict is deprecated, use ppeDict instead"
11+
getfield(x, :ppeDict)
12+
else
13+
getfield(x,f)
14+
end
15+
end
16+
17+
18+
19+
"""
20+
$SIGNATURES
21+
22+
Return the estimates for a variable.
23+
"""
24+
function getEstimates(v::VariableDataLevel1)
25+
@warn "Deprecated getEstimates, use getVariablePPE/getPPE instead."
26+
getVariablePPEs(vari)
27+
end
28+
29+
"""
30+
$SIGNATURES
31+
32+
Return the estimates for a variable.
33+
34+
DEPRECATED, estimates -> getVariablePPEs/getPPEs
35+
"""
36+
function estimates(v::VariableDataLevel1)
37+
@warn "Deprecated estimates, use getVariablePPEs/getPPE instead."
38+
getVariablePPEs(v)
39+
end
40+
41+
"""
42+
$SIGNATURES
43+
44+
Return a keyed estimate (default is :default) for a variable.
45+
46+
DEPRECATED use getVariablePPE/getPPE instead.
47+
"""
48+
function getEstimate(v::VariableDataLevel1, key::Symbol=:default)
49+
@warn "Deprecated getEstimate, use getVariablePPE/getPPE instead."
50+
getVariablePPE(v, key)
51+
end
52+
53+
"""
54+
$SIGNATURES
55+
56+
Return a keyed estimate (default is :default) for a variable.
57+
"""
58+
function estimate(v::VariableDataLevel1, key::Symbol=:default)
59+
@warn "DEPRECATED estimate, use getVariablePPE/getPPE instead."
60+
getVariablePPE(v, key)
61+
end
62+
63+
64+
"""
65+
$SIGNATURES
66+
67+
Return the softtype for a variable.
68+
69+
DEPRECATED, softtype -> getSofttype
70+
"""
71+
function softtype(v::VariableDataLevel1)
72+
@warn "Deprecated softtype, use getSofttype instead."
73+
getSofttype(v)
74+
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ export AbstractParams, NoSolverParams
2121
export DFGNode, DFGVariable, DFGFactor, AbstractDFGVariable, AbstractDFGFactor
2222
export InferenceType, PackedInferenceType, FunctorInferenceType, InferenceVariable, ConvolutionObject
2323
export FunctorSingleton, FunctorPairwise, FunctorPairwiseMinimize
24-
export getMaxPPE, getMeanPPE, getSuggestedPPE, getEstimates
25-
export getVariablePPE
24+
export getMaxPPE, getMeanPPE, getSuggestedPPE, getVariablePPE, getPPE, getVariablePPEs, getPPEs #, getEstimates
2625
export timestamp # DEPRECATED
2726
export label, getTimestamp, setTimestamp!, tags, setTags!, estimates, estimate, data, softtype, solverData, getData, solverDataDict, setSolverData, setSolverData!, internalId, smallData, setSmallData!, bigData
2827
export DFGVariableSummary, DFGFactorSummary, AbstractDFGSummary
@@ -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

0 commit comments

Comments
 (0)