Skip to content

Commit 993e9b6

Browse files
authored
Cleanup old deprection of VariableState.variableType (#1143)
1 parent ee04f00 commit 993e9b6

File tree

6 files changed

+12
-32
lines changed

6 files changed

+12
-32
lines changed

src/Deprecated.jl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -458,24 +458,3 @@ DFGSummary(args) = error("DFGSummary is deprecated")
458458
@deprecate getSummary(dfg::AbstractDFG) getSummaryGraph(dfg)
459459

460460
@deprecate getKey(store::AbstractBlobstore) getLabel(store)
461-
462-
##------------------------------------------------------------------------------
463-
## smallData
464-
##------------------------------------------------------------------------------
465-
@deprecate getSmallData(args...) getMetadata(args...)
466-
@deprecate setSmallData!(args...) setMetadata!(args...)
467-
@deprecate addSmallData!(args...) addMetadata!(args...)
468-
@deprecate updateSmallData!(args...) updateMetadata!(args...)
469-
@deprecate deleteSmallData!(args...) deleteMetadata!(args...)
470-
@deprecate listSmallData(args...) listMetadata(args...)
471-
@deprecate emptySmallData!(args...) emptyMetadata!(args...)
472-
473-
## ================================================================================
474-
## Deprecated in v0.24
475-
##=================================================================================
476-
@deprecate getBlobEntry(var::AbstractDFGVariable, key::AbstractString) getBlobEntryFirst(
477-
var,
478-
Regex(key),
479-
)
480-
481-
@deprecate lsfWho(dfg::AbstractDFG, type::Symbol) lsf(dfg, getfield(Main, type))

src/entities/DFGFactor.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Base.@kwdef struct FactorDFG <: AbstractDFGFactor
6464
nstime::String
6565
fnctype::String
6666
solvable::Int
67-
data::Union{Nothing, String} = nothing #TODO deprecate data completely, left as a bridge to old serialization structure
67+
data::Union{Nothing, String} = nothing #TODO v0.27 deprecate data completely, left as a bridge to old serialization structure
6868
metadata::String
6969
_version::String = string(_getDFGVersion())
7070
state::FactorState
@@ -119,7 +119,7 @@ function FactorDFG(
119119
nstime,
120120
fnctype,
121121
solvable,
122-
nothing, #TODO deprecate data completely
122+
nothing, #TODO v0.27 deprecate data completely
123123
metadata,
124124
_version,
125125
state,
@@ -177,7 +177,7 @@ function FactorDFG(
177177
metadata = base64encode(JSON3.write(metadata)),
178178
state,
179179
observJSON = JSON3.write(fnc),
180-
data = "", #TODO deprecate data completely
180+
data = "", #TODO v0.27 deprecate data completely
181181
)
182182

183183
return factor

src/entities/DFGVariable.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Fields:
2020
$(TYPEDFIELDS)
2121
"""
2222
Base.@kwdef mutable struct VariableState{T <: InferenceVariable, P, N}
23-
"DEPRECATED remove in DFG v0.22"
24-
variableType::T = T() #tricky deprecation, also change covar to using N and not variableType
2523
"""
2624
Globally unique identifier.
2725
"""
@@ -36,11 +34,11 @@ Base.@kwdef mutable struct VariableState{T <: InferenceVariable, P, N}
3634
bw::Matrix{Float64} = zeros(0, 0)
3735
"Parametric (Gaussian) covariance."
3836
covar::Vector{SMatrix{N, N, Float64}} =
39-
SMatrix{getDimension(variableType), getDimension(variableType), Float64}[]
37+
SMatrix{getDimension(T), getDimension(T), Float64}[]
4038
BayesNetOutVertIDs::Vector{Symbol} = Symbol[]
4139
dimIDs::Vector{Int} = Int[] # TODO Likely deprecate
4240

43-
dims::Int = getDimension(variableType) #TODO should we deprecate in favor of N
41+
dims::Int = getDimension(T) #TODO should we deprecate in favor of N
4442
"""
4543
Flag used by junction (Bayes) tree construction algorithm to know whether this variable has yet been included in the tree construction.
4644
"""
@@ -54,7 +52,7 @@ Base.@kwdef mutable struct VariableState{T <: InferenceVariable, P, N}
5452
"""
5553
Stores the amount information (per measurement dimension) captured in each coordinate dimension.
5654
"""
57-
infoPerCoord::Vector{Float64} = zeros(getDimension(variableType))
55+
infoPerCoord::Vector{Float64} = zeros(getDimension(T))
5856
"""
5957
Should this variable solveKey be treated as marginalized in inference computations.
6058
"""

src/services/AbstractDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ end
781781
$(SIGNATURES)
782782
Lists the factors of a specific type in the factor graph.
783783
Example, list all the Point2Point2 factors in the factor graph `dfg`:
784-
lsfWho(dfg, :Point2Point2)
784+
lsf(dfg, Point2Point2)
785785
786786
Notes
787787
- Return `Vector{Symbol}`

src/services/DFGVariable.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,8 @@ function copytoVariableState!(
714714
stateLabel::Symbol,
715715
state::VariableState,
716716
)
717-
newstate = VariableState(;
717+
newstate = VariableState(
718+
getVariableType(state);
718719
(k => getproperty(state, k) for k in fieldnames(VariableState))...,
719720
solveKey = stateLabel,
720721
)

src/services/Serialization.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ function unpackVariable(variable::VariableDFG; skipVersionCheck::Bool = false)
242242

243243
ppeDict =
244244
Dict{Symbol, MeanMaxPPE}(map(p -> p.solveKey, variable.ppes) .=> variable.ppes)
245-
solverDict = Dict{Symbol, VariableState{variableType, pointType}}(
245+
246+
N = getDimension(variableType)
247+
solverDict = Dict{Symbol, VariableState{variableType, pointType, N}}(
246248
map(sd -> sd.solveKey, variable.solverData) .=>
247249
map(sd -> DFG.unpackVariableState(sd), variable.solverData),
248250
)

0 commit comments

Comments
 (0)