Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bandaid on updateVariableSolverData! #566

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/Deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,8 @@ const AbstractBigDataEntry = AbstractDataEntry
##==============================================================================
## Remove in 0.11
##==============================================================================

@deprecate addVariableSolverData!(dfg::AbstractDFG, variablekey::Symbol, vnd::VariableNodeData, solverKey::Symbol) addVariableSolverData!(dfg, variablekey, vnd)

@deprecate updateVariableSolverData!(dfg::AbstractDFG,
variablekey::Symbol,
vnd::VariableNodeData,
solverKey::Symbol,
useCopy::Bool=true,
fields::Vector{Symbol}=Symbol[],
verbose::Bool=true ) updateVariableSolverData!(dfg, variablekey, vnd, useCopy, fields, verbose)


@deprecate updatePPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) updatePPE!(dfg, variablekey, ppe)

@deprecate addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::AbstractPointParametricEst, ppekey::Symbol) addPPE!(dfg, variablekey, ppe)
Expand Down
23 changes: 22 additions & 1 deletion src/services/DFGVariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,27 @@ function updateVariableSolverData!(dfg::AbstractDFG,
return var.solverDataDict[vnd.solverKey]
end


function updateVariableSolverData!(dfg::AbstractDFG,
variablekey::Symbol,
vnd::VariableNodeData,
solverKey::Symbol,
useCopy::Bool=true,
fields::Vector{Symbol}=Symbol[],
verbose::Bool=true)

# TODO not very clean
if vnd.solverKey != solverKey
@warn "TODO It looks like solverKey as parameter is deprecated, set it in vnd, or keep this function?"
usevnd = useCopy ? deepcopy(vnd) : vnd
usevnd.solverKey = solverKey
return updateVariableSolverData!(dfg, variablekey, usevnd, useCopy, fields, verbose)
else
return updateVariableSolverData!(dfg, variablekey, vnd, useCopy, fields, verbose)
end
end


updateVariableSolverData!(dfg::AbstractDFG,
sourceVariable::DFGVariable,
solverKey::Symbol=:default,
Expand Down Expand Up @@ -441,7 +462,7 @@ function deepcopySolvekeys!(dfg::AbstractDFG,
for x in labels
sd = deepcopy(getSolverData(getVariable(dfg,x), src))
sd.solverKey = dest
updateVariableSolverData!(dfg, x, true, Symbol[], verbose )
updateVariableSolverData!(dfg, x, sd, true, Symbol[], verbose )
end
end
const deepcopySupersolve! = deepcopySolvekeys!
Expand Down