Skip to content

Node query processing steps

perrydv edited this page May 17, 2017 · 4 revisions

Steps in processing various model queries about nodes.

Of particular interest are cases where a LHSinferred node name is provided in a nodes argument to a step where it might be parsed and evaluated in a vars2... environment. Either LHSinferred names must be ensured safe or that processing path must be prevented.

Model methods and relevance

Notes include which other major methods, or modelDef or modelDef$maps data or methods, are used.

  • Uses expandNodeNames(...returnType = 'ids') | modelDef$maps$isEndNode_byGID.
  • Uses modelDef$nodeName2GraphIDs
  • Uses modelDef$nodeName2GraphIDs
  • Uses expandNodeNames | getDeclnfo

  • Circuitous: expandNodeNames goes to graphIDs and back to names. getDeclInfo goes to getDeclID which goes back to graphIDs in order to declIDs

  • Uses expandNodeNames | getDistribution

  • This and several others are circuitous (back and forth between graphIDs and names multiple times)

  • Uses expandNodeNames | getDistribution, getParamExpr
  • Uses expandNodeNames | getNodeType
  • Uses expandNodeNames | getDeclnfo
  • Uses expandNodeNames | getDistribution
  • Uses modelDef$nodeName2GraphIDs | modelDef$graphIDs2indexedNodeInfo
  • Previous: Uses isDataFromGraphID(modelDef$maps$graphIDs) twice (note this is on all graphIDs)

  • Previous: Uses expandNodeNames(modelDef$maps$graphID_2_nodeName[validValues],...)

  • New (fixIssue340): filters out LHSinferred types from the begining. Uses new expandNodeNamesFromGraphIDs to avoid ID -> name -> ID -> name where the middle "name -> ID" could break from a LHSinferred node.

  • Uses modelDef$nodeName2GraphIDs | modelDef$maps$elementNames[graphID], modelDef$maps$graphID_2_nodeName[graphID]

  • Will not get vertexIDs, so will not return vertex names, hence will not return LHSinferred names.

  • Uses expandNodeNames(..., returnType = 'ids') | expandNodeNames (not a typo)

getSymbolTable

init_isDataEnv

resetData

setData

testDataFlags

  • Uses getNodeNames() | eval(parse(...), envir = isDataEnv)

isData

  • Uses modelDef$nodeName2GraphIDs | isDataFromGraphID

  • This is safe because no vertexIDs (hence no LHSinferred nodes) are passed to isDataFromGraphID

isDataFromGraphID

  • Uses modelDef$maps$graphID_2_nodeName | eval(parse(...), envir = isDataEnv), so cannot accept a vertex name such as a split LHSinferred name.

getDependenciesList provides access to modelDef$maps$edgesFrom2To, sorted and/or named

  • Uses modelDef$maps$graphID_2_nodeName

  • Should be safe.

  • No longer used anywhere, so could be deprecated.

getDependencyPathCountOneNode

  • Uses modelDef$nodeName2GraphIDs | modelDef$maps$nimbleGraph$getDependencyPathCountOneNode

  • Should be safe because latter function dives into C++ getDependencyPathCountOneNode, which should handle any index.

  • Used only from conjugacyRelationshipsClass::checkConjugacy

getDependencies

  • Uses modelDef$nodeName2GraphIDs | modelDef$maps$elementID_2_vertexID | modelDef$maps$nimbleGraph$getDependencies | modelDef$maps$types, isDataFromGraphID, modelDef$nodeName2GraphIDs(modelDef$maps$graphID_2_nodeName[depIDs], modelDef$maps$elementNames, modelDef$maps$nodeNames

getDownstream

setInits

checkConjugacy

checkBasics

Underlying modelDef methods and data used by above

nodeName2GraphIDs returns either graphIDs (nodeFunctions and RHSonly) (if nodeFunctionID == TRUE) or elementIDs.

  • Calls parseEval... steps so cannot take LHSinferred names as input.

  • Uses maps$vars2GraphID_functions_and_RHSonly or maps$vars2ID_elements, so returns either graphIDs or elementIDs (not vertexIDs)

Clone this wiki locally