[ui] Recompute and Re-submit not allowed with Compatibility Nodes

Renaming of canCompute to canComputeTopologically to understand the static aspect of the function
This commit is contained in:
Aurore LAFAURIE 2024-08-20 11:52:34 +02:00 committed by Fabien Castan
parent 24b7a378f8
commit b6df2852e7
3 changed files with 21 additions and 11 deletions

View file

@ -1132,9 +1132,10 @@ class Graph(BaseObject):
return nodes, edges
@Slot(Node, result=bool)
def canCompute(self, node):
def canComputeTopologically(self, node):
"""
Return the computability of a node based on itself and its dependency chain.
It is a static result as it depends on the graph topology.
Computation can't happen for:
- CompatibilityNodes
- nodes having a non-computed CompatibilityNode in its dependency chain
@ -1200,7 +1201,7 @@ class Graph(BaseObject):
self.dfs(visitor=visitor, startNodes=leaves)
# update graph computability status
canComputeLeaves = all([self.canCompute(node) for node in leaves])
canComputeLeaves = all([self.canComputeTopologically(node) for node in leaves])
if self._canComputeLeaves != canComputeLeaves:
self._canComputeLeaves = canComputeLeaves
self.canComputeLeavesChanged.emit()
@ -1290,6 +1291,7 @@ class Graph(BaseObject):
def canSubmitOrCompute(self, startNode):
"""
Check if a node can be submitted/computed.
It does not depend on the topology of the graph and is based on the node status and its dependencies.
Returns:
int: 0 = cannot be submitted or computed /