Skip to content

Commit 8dc0d52

Browse files
committed
remove all return types close #374
1 parent 80f4295 commit 8dc0d52

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

src/Common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $(SIGNATURES)
9191
9292
Returns true if the label is valid for a session, robot, or user ID.
9393
"""
94-
function isValidLabel(id::Union{Symbol, String})::Bool
94+
function isValidLabel(id::Union{Symbol, String})
9595
if typeof(id) == Symbol
9696
id = String(id)
9797
end

src/GraphsDFG/FactorGraphs/FactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function addFactor!(
134134
g::FactorGraph{T, V, F},
135135
variableLabels::Vector{Symbol},
136136
factor::F,
137-
)::Bool where {T, V, F}
137+
) where {T, V, F}
138138
haskey(g.labels, factor.label) &&
139139
(@error "Label $(factor.label) already in fg"; return false)
140140

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
function addVariable!(
4242
dfg::GraphsDFG{<:AbstractParams, V, <:AbstractDFGFactor},
4343
variable::V,
44-
)::V where {V <: AbstractDFGVariable}
44+
) where {V <: AbstractDFGVariable}
4545
#TODO should this be an error
4646
if haskey(dfg.g.variables, variable.label)
4747
error("Variable '$(variable.label)' already exists in the factor graph")
@@ -58,7 +58,7 @@ end
5858
function addVariable!(
5959
dfg::GraphsDFG{<:AbstractParams, VD, <:AbstractDFGFactor},
6060
variable::AbstractDFGVariable,
61-
)::VD where {VD <: AbstractDFGVariable}
61+
) where {VD <: AbstractDFGVariable}
6262
return addVariable!(dfg, VD(variable))
6363
end
6464

@@ -186,7 +186,7 @@ function deleteFactor!(
186186
dfg::GraphsDFG,
187187
label::Symbol;
188188
suppressGetFactor::Bool = false,
189-
)::AbstractDFGFactor
189+
)
190190
if !haskey(dfg.g.factors, label)
191191
error("Factor label '$(label)' does not exist in the factor graph")
192192
end
@@ -285,12 +285,12 @@ function listFactors(
285285
return factors::Vector{Symbol}
286286
end
287287

288-
function isConnected(dfg::GraphsDFG)::Bool
288+
function isConnected(dfg::GraphsDFG)
289289
return Graphs.is_connected(dfg.g)
290290
# return length(Graphs.connected_components(dfg.g)) == 1
291291
end
292292

293-
function _isSolvable(dfg::GraphsDFG, label::Symbol, ready::Int)::Bool
293+
function _isSolvable(dfg::GraphsDFG, label::Symbol, ready::Int)
294294
haskey(dfg.g.variables, label) && (return dfg.g.variables[label].solvable >= ready)
295295
haskey(dfg.g.factors, label) && (return dfg.g.factors[label].solvable >= ready)
296296

@@ -321,7 +321,7 @@ function listNeighbors(dfg::GraphsDFG, node::DFGNode; solvable::Int = 0)
321321
return neighbors_ll::Vector{Symbol}
322322
end
323323

324-
function listNeighbors(dfg::GraphsDFG, label::Symbol; solvable::Int = 0)::Vector{Symbol}
324+
function listNeighbors(dfg::GraphsDFG, label::Symbol; solvable::Int = 0)
325325
if !exists(dfg, label)
326326
error("Variable/factor with label '$(label)' does not exist in the factor graph")
327327
end
@@ -345,7 +345,7 @@ function getNeighborhood(
345345
variableFactorLabels::Vector{Symbol},
346346
distance::Int;
347347
solvable::Int = 0,
348-
)::Vector{Symbol}
348+
)
349349
# find neighbors at distance to add
350350
nbhood = Int[]
351351

@@ -375,10 +375,7 @@ function getBiadjacencyMatrix(
375375
solvable::Int = 0,
376376
varLabels = listVariables(dfg; solvable = solvable),
377377
factLabels = listFactors(dfg; solvable = solvable),
378-
)::NamedTuple{
379-
(:B, :varLabels, :facLabels),
380-
Tuple{Graphs.SparseMatrixCSC, Vector{Symbol}, Vector{Symbol}},
381-
}
378+
)
382379
varIndex = [dfg.g.labels[s] for s in varLabels]
383380
factIndex = [dfg.g.labels[s] for s in factLabels]
384381

src/services/AbstractDFG.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ function listFactors(
637637
regexFilter::Union{Nothing, Regex} = nothing;
638638
tags::Vector{Symbol} = Symbol[],
639639
solvable::Int = 0,
640-
)::Vector{Symbol} where {G <: AbstractDFG}
640+
) where {G <: AbstractDFG}
641641
return map(f -> f.label, getFactors(dfg, regexFilter; tags = tags, solvable = solvable))
642642
end
643643

@@ -754,7 +754,7 @@ function lsf(
754754
dfg::G,
755755
label::Symbol;
756756
solvable::Int = 0,
757-
)::Vector{Symbol} where {G <: AbstractDFG}
757+
) where {G <: AbstractDFG}
758758
return listNeighbors(dfg, label; solvable = solvable)
759759
end
760760

src/services/CommonAccessors.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ Variables or factors may or may not be 'solvable', depending on a user definitio
8888
Related:
8989
- isSolveInProgress
9090
"""
91-
getSolvable(var::Union{DFGVariable, DFGFactor})::Int = var.solvable
91+
getSolvable(var::Union{DFGVariable, DFGFactor}) = var.solvable
9292
#TODO DataLevel2
9393

9494
"""
9595
$SIGNATURES
9696
9797
Get 'solvable' parameter for either a variable or factor.
9898
"""
99-
function getSolvable(dfg::AbstractDFG, sym::Symbol)::Int
99+
function getSolvable(dfg::AbstractDFG, sym::Symbol)
100100
if isVariable(dfg, sym)
101101
return getVariable(dfg, sym).solvable
102102
elseif isFactor(dfg, sym)
@@ -110,7 +110,7 @@ end
110110
111111
Set the `solvable` parameter for either a variable or factor.
112112
"""
113-
function setSolvable!(node::N, solvable::Int)::Int where {N <: DFGNode}
113+
function setSolvable!(node::N, solvable::Int) where {N <: DFGNode}
114114
node.solvable = solvable
115115
return solvable
116116
end
@@ -120,7 +120,7 @@ end
120120
121121
Set the `solvable` parameter for either a variable or factor.
122122
"""
123-
function setSolvable!(dfg::AbstractDFG, sym::Symbol, solvable::Int)::Int
123+
function setSolvable!(dfg::AbstractDFG, sym::Symbol, solvable::Int)
124124
if isVariable(dfg, sym)
125125
getVariable(dfg, sym).solvable = solvable
126126
elseif isFactor(dfg, sym)
@@ -158,7 +158,7 @@ isSolvable
158158
function getSolveInProgress(
159159
var::Union{DFGVariable, DFGFactor},
160160
solveKey::Symbol = :default,
161-
)::Int
161+
)
162162
# Variable
163163
if var isa DFGVariable
164164
if haskey(getSolverDataDict(var), solveKey)

src/services/DFGVariable.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ Retrieve the soft type name symbol for a DFGVariableSummary. ie :Point2, Pose2,
643643
"""
644644
getVariableTypeName(v::DFGVariableSummary) = v.variableTypeName::Symbol
645645

646-
function getVariableType(v::DFGVariableSummary)::InferenceVariable
646+
function getVariableType(v::DFGVariableSummary)
647647
@warn "Looking for type in `Main`. Only use if `variableType` has only one implementation, ie. Pose2. Otherwise use the full variable."
648648
return getfield(Main, v.variableTypeName)()
649649
end
@@ -921,7 +921,7 @@ end
921921
$(SIGNATURES)
922922
List all the solver data keys in the variable.
923923
"""
924-
function listVariableSolverData(dfg::AbstractDFG, variablekey::Symbol)::Vector{Symbol}
924+
function listVariableSolverData(dfg::AbstractDFG, variablekey::Symbol)
925925
v = getVariable(dfg, variablekey)
926926
return collect(keys(v.solverDataDict))
927927
end

0 commit comments

Comments
 (0)