Skip to content

Commit 2c8d198

Browse files
committed
Cleanup for new inheritance
1 parent 6f7c5c0 commit 2c8d198

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/MetaGraphsDFG/services/MetaGraphsDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ Note
557557
- Based on graphviz.org
558558
"""
559559
function toDotFile(dfg::MetaGraphsDFG, fileName::String="/tmp/dfg.dot")::Nothing
560-
@error "toDotFile(dfg::MetaGraphsDFG,filename) is not sopported yet, see https://github.com/JuliaGraphs/MetaGraphs.jl/issues/86"
560+
@error "toDotFile(dfg::MetaGraphsDFG,filename) is not supported yet, see https://github.com/JuliaGraphs/MetaGraphs.jl/issues/86"
561561
open(fileName, "w") do fid
562562
MetaGraphs.savedot(fid, dfg.g)
563563
end

src/services/AbstractDFG.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,47 +85,47 @@ end
8585
$(SIGNATURES)
8686
Get a DFGVariable from a DFG using its underlying integer ID.
8787
"""
88-
function getVariable(dfg::G, variableId::Int64)::DFGVariable where G <: AbstractDFG
88+
function getVariable(dfg::G, variableId::Int64)::AbstractDFGVariable where G <: AbstractDFG
8989
error("getVariable not implemented for $(typeof(dfg))")
9090
end
9191

9292
"""
9393
$(SIGNATURES)
9494
Get a DFGVariable from a DFG using its label.
9595
"""
96-
function getVariable(dfg::G, label::Union{Symbol, String})::DFGVariable where G <: AbstractDFG
96+
function getVariable(dfg::G, label::Union{Symbol, String})::AbstractDFGVariable where G <: AbstractDFG
9797
return getVariable(dfg, Symbol(label))
9898
end
9999

100100
"""
101101
$(SIGNATURES)
102102
Get a DFGFactor from a DFG using its underlying integer ID.
103103
"""
104-
function getFactor(dfg::G, factorId::Int64)::DFGFactor where G <: AbstractDFG
104+
function getFactor(dfg::G, factorId::Int64)::AbstractDFGFactor where G <: AbstractDFG
105105
error("getFactor not implemented for $(typeof(dfg))")
106106
end
107107

108108
"""
109109
$(SIGNATURES)
110110
Get a DFGFactor from a DFG using its label.
111111
"""
112-
function getFactor(dfg::G, label::Union{Symbol, String})::DFGFactor where G <: AbstractDFG
112+
function getFactor(dfg::G, label::Union{Symbol, String})::AbstractDFGFactor where G <: AbstractDFG
113113
return getFactor(dfg, Symbol(label))
114114
end
115115

116116
"""
117117
$(SIGNATURES)
118118
Update a complete DFGVariable in the DFG.
119119
"""
120-
function updateVariable!(dfg::G, variable::V)::DFGVariable where {G <: AbstractDFG, V <: AbstractDFGVariable}
120+
function updateVariable!(dfg::G, variable::V)::AbstractDFGVariable where {G <: AbstractDFG, V <: AbstractDFGVariable}
121121
error("updateVariable! not implemented for $(typeof(dfg))")
122122
end
123123

124124
"""
125125
$(SIGNATURES)
126126
Update a complete DFGFactor in the DFG.
127127
"""
128-
function updateFactor!(dfg::G, factor::F)::DFGFactor where {G <: AbstractDFG, F <: AbstractDFGFactor}
128+
function updateFactor!(dfg::G, factor::F)::AbstractDFGFactor where {G <: AbstractDFG, F <: AbstractDFGFactor}
129129
error("updateFactor! not implemented for $(typeof(dfg))")
130130
end
131131

@@ -470,13 +470,14 @@ Returns state of vertex data `.initialized` flag.
470470
471471
Notes:
472472
- used by both factor graph variable and Bayes tree clique logic.
473-
TODO: Refactor
474473
"""
475474
function isInitialized(var::DFGVariable; key::Symbol=:default)::Bool
476-
return var.solverDataDict[key].initialized
475+
solverData(var, key) && return solverData(var, key).initialized
476+
return false
477477
end
478478
function isInitialized(fct::DFGFactor; key::Symbol=:default)::Bool
479-
return fct.solverDataDict[key].initialized
479+
solverData(var, key) && return solverData(fct, key).initialized
480+
return false
480481
end
481482
function isInitialized(dfg::G, label::Symbol; key::Symbol=:default)::Bool where G <: AbstractDFG
482483
return isInitialized(getVariable(dfg, label), key=key)

0 commit comments

Comments
 (0)