Skip to content

Commit 3bd47e4

Browse files
authored
Merge pull request #801 from JuliaRobotics/21Q3/enh/dropbadreturntypes
drop bad (forced) function level return types
2 parents b5b84ff + 2164578 commit 3bd47e4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.15.2"
3+
version = "0.15.3"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/LightDFG/services/LightDFG.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ function deleteFactor!(dfg::LightDFG, label::Symbol)::AbstractDFGFactor
155155
return factor
156156
end
157157

158-
function getVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{AbstractDFGVariable}
158+
function getVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)
159159

160160
# variables = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGVariable, vertices(dfg.g)))
161161
variables = collect(values(dfg.g.variables))
162-
if regexFilter != nothing
162+
if regexFilter !== nothing
163163
variables = filter(v -> occursin(regexFilter, String(v.label)), variables)
164164
end
165165
if solvable != 0
@@ -172,20 +172,20 @@ function getVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing;
172172
return variables
173173
end
174174

175-
function listVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{Symbol}
175+
function listVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)
176176

177177
# variables = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGVariable, vertices(dfg.g)))
178178
if length(tags) > 0
179179
return map(v -> v.label, getVariables(dfg, regexFilter, tags=tags, solvable=solvable))
180180
else
181181
variables = collect(keys(dfg.g.variables))
182-
regexFilter != nothing && (variables = filter(v -> occursin(regexFilter, String(v)), variables))
182+
regexFilter !== nothing && (variables = filter(v -> occursin(regexFilter, String(v)), variables))
183183
solvable != 0 && (variables = filter(vId -> _isSolvable(dfg, vId, solvable), variables))
184-
return variables
184+
return variables::Vector{Symbol}
185185
end
186186
end
187187

188-
function getFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{AbstractDFGFactor}
188+
function getFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)
189189
# factors = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGFactor, vertices(dfg.g)))
190190
factors = collect(values(dfg.g.factors))
191191
if regexFilter != nothing
@@ -201,7 +201,7 @@ function getFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; t
201201
return factors
202202
end
203203

204-
function listFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{Symbol}
204+
function listFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)
205205
# factors = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGFactor, vertices(dfg.g)))
206206
if length(tags) > 0
207207
return map(v -> v.label, getFactors(dfg, regexFilter, tags=tags, solvable=solvable))
@@ -213,7 +213,7 @@ function listFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing;
213213
if solvable != 0
214214
factors = filter(fId -> _isSolvable(dfg, fId, solvable), factors)
215215
end
216-
return factors
216+
return factors::Vector{Symbol}
217217
end
218218

219219
function isConnected(dfg::LightDFG)::Bool
@@ -231,7 +231,7 @@ function _isSolvable(dfg::LightDFG, label::Symbol, ready::Int)::Bool
231231
return false
232232
end
233233

234-
function getNeighbors(dfg::LightDFG, node::DFGNode; solvable::Int=0)::Vector{Symbol}
234+
function getNeighbors(dfg::LightDFG, node::DFGNode; solvable::Int=0)
235235
label = node.label
236236
if !exists(dfg, label)
237237
error("Variable/factor with label '$(node.label)' does not exist in the factor graph")
@@ -248,7 +248,7 @@ function getNeighbors(dfg::LightDFG, node::DFGNode; solvable::Int=0)::Vector{Sym
248248
return order
249249
end
250250

251-
return neighbors_ll
251+
return neighbors_ll::Vector{Symbol}
252252
end
253253

254254

0 commit comments

Comments
 (0)