Skip to content

Commit

Permalink
Merge pull request #811 from JuliaRobotics/master
Browse files Browse the repository at this point in the history
Release 0.16.2
  • Loading branch information
GearsAD authored Oct 17, 2021
2 parents e8a8ce1 + e602da9 commit 0022ff8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DistributedFactorGraphs"
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
version = "0.16.1"
version = "0.16.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
11 changes: 6 additions & 5 deletions src/CloudGraphsDFG/services/CloudGraphsDFG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,10 @@ end
#Alias
deleteVariable!(dfg::CloudGraphsDFG, variable::DFGVariable) = deleteVariable!(dfg, variable.label)

function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol)::DFGFactor
factor = getFactor(dfg, label)
if factor == nothing
# return ::DFGFactor, or workaround ::Nothing, #809
function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol; suppressGetFactor::Bool=false)
factor = suppressGetFactor ? nothing : getFactor(dfg, label)
if factor === nothing && !suppressGetFactor
error("Unable to retrieve the ID for factor '$label'. Please check your connection to the database and that the factor exists.")
end
# Perform detach+deletion
Expand All @@ -378,7 +379,7 @@ function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol)::DFGFactor
end

# Alias
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor)::DFGFactor = deleteFactor!(dfg, factor.label)
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; suppressGetFactor::Bool=false) = deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)

function getVariables(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{DFGVariable}
variableIds = listVariables(dfg, regexFilter, tags=tags, solvable=solvable)
Expand Down Expand Up @@ -980,4 +981,4 @@ function SkeletonDFG(cfg::CloudGraphsDFG)
addVariable!.(sfg, _getSkeletonVariables(cfg))
addFactor!.(sfg, _getSkeletonFactors(cfg))
return sfg
end
end
2 changes: 1 addition & 1 deletion src/LightDFG/services/LightDFG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function deleteVariable!(dfg::LightDFG, label::Symbol)#::Tuple{AbstractDFGVariab
return variable, neigfacs
end

function deleteFactor!(dfg::LightDFG, label::Symbol)::AbstractDFGFactor
function deleteFactor!(dfg::LightDFG, label::Symbol; suppressGetFactor::Bool=false)::AbstractDFGFactor
if !haskey(dfg.g.factors, label)
error("Factor label '$(label)' does not exist in the factor graph")
end
Expand Down
6 changes: 3 additions & 3 deletions src/services/AbstractDFG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ end
$(SIGNATURES)
Delete a DFGFactor from the DFG using its label.
"""
function deleteFactor!(dfg::G, label::Symbol) where G <: AbstractDFG
function deleteFactor!(dfg::G, label::Symbol; suppressGetFactor::Bool=false) where G <: AbstractDFG
error("deleteFactors not implemented for $(typeof(dfg))")
end

Expand Down Expand Up @@ -449,8 +449,8 @@ end
$(SIGNATURES)
Delete the referened DFGFactor from the DFG.
"""
function deleteFactor!(dfg::G, factor::F) where {G <: AbstractDFG, F <: AbstractDFGFactor}
return deleteFactor!(dfg, factor.label)
function deleteFactor!(dfg::G, factor::F; suppressGetFactor::Bool=false) where {G <: AbstractDFG, F <: AbstractDFGFactor}
return deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)
end

# Alias - bit ridiculous but know it'll come up at some point. Does existential and type check.
Expand Down

0 comments on commit 0022ff8

Please sign in to comment.