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

Deprecated subgraph functions in CGDFG #650

Open
Affie opened this issue Aug 31, 2020 · 3 comments
Open

Deprecated subgraph functions in CGDFG #650

Affie opened this issue Aug 31, 2020 · 3 comments

Comments

@Affie
Copy link
Member

Affie commented Aug 31, 2020

function getSubgraphAroundNode(dfg::CloudGraphsDFG, node::DFGNode, distance::Int64=1, includeOrphanFactors::Bool=false, addToDFG::AbstractDFG=_getDuplicatedEmptyDFG(dfg); solvable::Int=0)::AbstractDFG
distance < 1 && error("getSubgraphAroundNode() only works for distance > 0")
# Thank you Neo4j for 0..* awesomeness!!
neighborList = _getLabelsFromCyphonQuery(dfg.neo4jInstance,
"""
(n:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId):$(node.label))-[FACTORGRAPH*0..$distance]-(node:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId))
WHERE (n:VARIABLE OR n:FACTOR OR node:VARIABLE OR node:FACTOR)
and not (node:SESSION)
and (node.solvable >= $solvable or node:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId):$(node.label))""" # Always return the root node
)
# Copy the section of graph we want
_copyIntoGraph!(dfg, addToDFG, neighborList, includeOrphanFactors)
return addToDFG
end
function getSubgraph(dfg::CloudGraphsDFG,
variableFactorLabels::Vector{Symbol},
includeOrphanFactors::Bool=false,
addToDFG::G=_getDuplicatedEmptyDFG(dfg) )::G where {G <: AbstractDFG}
# Making a copy session if not specified
_copyIntoGraph!(dfg, addToDFG, variableFactorLabels, includeOrphanFactors)
return addToDFG
end

see

@dehann
Copy link
Member

dehann commented Aug 31, 2020

hi, thanks for finding this. although this needs work, i would recommend deferring the effort in the short term and only return to consolidate cgdfg subgraph when it becomes really necessary or sensible to do so. If we can limp along on current cgdfg implementation for a while, that should be okay.

@Affie
Copy link
Member Author

Affie commented Aug 31, 2020

It looks like more of a maintenance thing with the functions missed with the deletion of the deprecations.

However, CGDFG can still overwrite buildSubgraph and/or copyGraph! for performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants