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

variable solver data concept #231

Closed
wants to merge 22 commits into from

Conversation

Affie
Copy link
Member

@Affie Affie commented Dec 4, 2019

draft to help with the discussion in #182 concept

@dehann dehann self-requested a review December 4, 2019 16:27
@dehann
Copy link
Member

dehann commented Dec 4, 2019

will look and answer through review, thanks for getting this going!

@dehann dehann added the enhancement New feature or request label Dec 11, 2019
@dehann dehann added this to the v0.5.x milestone Dec 11, 2019
@dehann dehann added the API label Dec 11, 2019
@Affie Affie changed the base branch from master to 4Q19/poc/v0_6 January 17, 2020 09:47
@Affie Affie marked this pull request as ready for review January 17, 2020 09:48
@codecov-io
Copy link

Codecov Report

Merging #231 into 4Q19/poc/v0_6 will decrease coverage by 1.63%.
The diff coverage is 47.18%.

Impacted file tree graph

@@                Coverage Diff                @@
##           4Q19/poc/v0_6     #231      +/-   ##
=================================================
- Coverage          68.78%   67.15%   -1.64%     
=================================================
  Files                 39       41       +2     
  Lines               2079     2195     +116     
=================================================
+ Hits                1430     1474      +44     
- Misses               649      721      +72
Impacted Files Coverage Δ
src/DistributedFactorGraphs.jl 100% <ø> (ø) ⬆️
src/SymbolDFG/entities/SymbolDFG.jl 80% <ø> (ø) ⬆️
src/LightDFG/entities/LightDFG.jl 33.33% <0%> (-46.67%) ⬇️
src/attic/MetaGraphsDFG/entities/MetaGraphsDFG.jl 0% <0%> (ø) ⬆️
src/Common.jl 30.37% <0%> (-10.98%) ⬇️
src/GraphsDFG/entities/GraphsDFG.jl 75% <0%> (-25%) ⬇️
src/services/DFGFactor.jl 64.15% <100%> (+1.4%) ⬆️
src/services/AbstractDFG.jl 61.58% <4.54%> (-7.65%) ⬇️
src/entities/DFGFactor.jl 88.23% <66.66%> (+2.52%) ⬆️
src/entities/DFGVariable.jl 60% <73.68%> (-1.71%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5826db...d7d26ed. Read the comment docs.

label::Symbol
timestamp::DateTime
tags::Vector{Symbol}
estimateDict::Dict{Symbol, <:AbstractPointParametricEst}
Copy link
Member

@dehann dehann Jan 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest v0.5.3 now has this as ppeDict

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see here:

ppeDict::Dict{Symbol, <:AbstractPointParametricEst}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will likely fall out naturally when merging all this to master, just ask to keep an eye on it when we do please.


Return the estimates for a variable.
"""
getEstimates(v::VariableDataLevel1) = v.estimateDict
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too has been deprecated, see master branch.

#
# buildSubgraphFromLabels!, _copyIntoGraph!, getVariableIds
# """
# function buildSubgraphFromLabels!_SPECIAL(dfg::G,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just and FYI: @Affie, this is your add hoc function for subGraph from a while back -- see #250

"""
function getVariableSolverData(dfg::AbstractDFG, variablekey::Symbol, solvekey::Symbol=:default)
error("not implemented")
return deepcopy(solverData(getVariable(dfg, variablekey), solvekey))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a deepcopy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should verb get not return the original memory object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think you are correct.


#var.solverDataDict[solvekey] = vnd

setSolverData(var, deepcopy(vnd), key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see updated api in master to include an !


#var.solverDataDict[solvekey] = deepcopy(vnd)
#for InMemoryDFGTypes, cloud would update here
setSolverData(var, deepcopy(vnd), key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why do a deep copy here? You think the user might accidentally point the code to the same vnd object and therefore become incorrect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should maybe leave the ‘deepcopy’ responsibility to the user.

error("VariableNodeData '$(solvekey)' already exists")
end

vnd = pop!(var.solverDataDict, solvekey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems right to me, will think on it more.

Copy link
Member

@dehann dehann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requesting changes based on the first deepcopy -- should the verb get not return the original memory object as standard behaviour?

@Affie
Copy link
Member Author

Affie commented Jan 18, 2020

Closing because of worry about merges. I will cherry pick or manually copy the relevant code.

@Affie Affie closed this Jan 18, 2020
@dehann dehann modified the milestones: v0.5.x, v0.6.0 Feb 18, 2020
@Affie Affie deleted the feature/4Q19/variabelSolverData branch August 31, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants