Skip to content

Commit 15e57d5

Browse files
authored
Merge pull request #562 from JuliaRobotics/bugfix/20Q3/fix#558
Fix add- update- VariableSolverData and PPE deprecation
2 parents d91beb3 + 14d9668 commit 15e57d5

File tree

2 files changed

+17
-48
lines changed

2 files changed

+17
-48
lines changed

src/Deprecated.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ const AbstractBigDataEntry = AbstractDataEntry
5757
##==============================================================================
5858
## Remove in 0.11
5959
##==============================================================================
60+
61+
@deprecate addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solverKey::Symbol) addVariableSolverData!(dfg, variablekey, vnd)
62+
63+
@deprecate updateVariableSolverData!(dfg::AbstractDFG,
64+
variablekey::Symbol,
65+
vnd::VariableNodeData,
66+
solverKey::Symbol,
67+
useCopy::Bool=true,
68+
fields::Vector{Symbol}=Symbol[],
69+
verbose::Bool=true ) updateVariableSolverData!(dfg, variablekey, vnd, useCopy, fields, verbose)
70+
71+
72+
@deprecate updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) updatePPE!(dfg, variablekey, ppe)
73+
74+
@deprecate addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) addPPE!(dfg, variablekey, ppe)
75+
76+
6077
export AbstractDataStore
6178
abstract type AbstractDataStore end
6279
struct GeneralDataEntry <: AbstractDataEntry end

src/services/DFGVariable.jl

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,6 @@ function getVariableSolverData(dfg::AbstractDFG, variablekey::Symbol, solvekey::
339339
end
340340

341341

342-
"""
343-
$(SIGNATURES)
344-
Deprecated: Add variable solver data, errors if it already exists.
345-
"""
346-
function addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solverKey::Symbol=:default)::VariableNodeData
347-
@warn "This function is deprecated and will be removed in the next version, please use addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData)"
348-
return addVariableSolverData!(dfg, variablekey, vnd)
349-
end
350-
351342
"""
352343
$(SIGNATURES)
353344
Add variable solver data, errors if it already exists.
@@ -369,28 +360,6 @@ NOTE: Copies the solver data.
369360
addVariableSolverData!(dfg::AbstractDFG, sourceVariable::DFGVariable, solverKey::Symbol=:default) =
370361
addVariableSolverData!(dfg, sourceVariable.label, deepcopy(getSolverData(sourceVariable, solverKey)))
371362

372-
"""
373-
$(SIGNATURES)
374-
Update variable solver data if it exists, otherwise add it.
375-
376-
Notes:
377-
- `useCopy=true` to copy solver data and keep separate memory.
378-
- Use `fields` to updated only a few VND.fields while adhering to `useCopy`.
379-
380-
Related
381-
382-
mergeVariableSolverData!
383-
"""
384-
function updateVariableSolverData!(dfg::AbstractDFG,
385-
variablekey::Symbol,
386-
vnd::VariableNodeData,
387-
solverKey::Symbol=:default,
388-
useCopy::Bool=true,
389-
fields::Vector{Symbol}=Symbol[],
390-
verbose::Bool=true )
391-
@warn "This function is deprecated, please use updateVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solverKey::Symbol=:default, useCopy::Bool=true, fields::Vector{Symbol}=Symbol, verbose::Bool=true)"
392-
return updateVariableSolverData!(dfg, variablekey, vnd, useCopy, fields, verbose)
393-
end
394363

395364
"""
396365
$(SIGNATURES)
@@ -553,15 +522,6 @@ end
553522
# Not the most efficient call but it at least reuses above (in memory it's probably ok)
554523
getPPE(dfg::AbstractDFG, sourceVariable::VariableDataLevel1, ppekey::Symbol=default)::AbstractPointParametricEst = getPPE(dfg, sourceVariable.label, ppekey)
555524

556-
"""
557-
$(SIGNATURES)
558-
Add variable PPE, errors if it already exists.
559-
"""
560-
function addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P, ppekey::Symbol=:default)::AbstractPointParametricEst where P <: AbstractPointParametricEst
561-
@warn("This function is deprecated, please call addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P)")
562-
return addPPE!(dfg, variablekey, ppe)
563-
end
564-
565525
"""
566526
$(SIGNATURES)
567527
Add variable PPE, errors if it already exists.
@@ -583,14 +543,6 @@ NOTE: Copies the PPE.
583543
addPPE!(dfg::AbstractDFG, sourceVariable::DFGVariable, ppekey::Symbol=:default) =
584544
addPPE!(dfg, sourceVariable.label, deepcopy(getPPE(sourceVariable, ppekey)))
585545

586-
"""
587-
$(SIGNATURES)
588-
Update PPE data if it exists, otherwise add it -- one call per `key::Symbol=:default`.
589-
"""
590-
function updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P, ppekey::Symbol=:default)::P where P <: AbstractPointParametricEst
591-
@warn("This function is deprecated, please call updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P)")
592-
return updatePPE!(dfg, variablekey, ppe)
593-
end
594546

595547
"""
596548
$(SIGNATURES)

0 commit comments

Comments
 (0)