mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-23 14:06:28 +02:00
[graph] add Node.clearSubmitterChunks method
This commit is contained in:
parent
72e3817ef0
commit
e8c8a9f64a
1 changed files with 14 additions and 7 deletions
|
@ -838,11 +838,19 @@ class Node(BaseObject):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def alreadySubmittedChunks(self):
|
def alreadySubmittedChunks(self):
|
||||||
submittedChunks = []
|
return [ch for ch in self._chunks if ch.isAlreadySubmitted()]
|
||||||
for chunk in self.chunks:
|
|
||||||
if chunk.isAlreadySubmitted():
|
@Slot()
|
||||||
submittedChunks.append(chunk)
|
def clearSubmittedChunks(self):
|
||||||
return submittedChunks
|
""" Reset all submitted chunks to Status.NONE. This method should be used to clear inconsistent status
|
||||||
|
if a computation failed without informing the graph.
|
||||||
|
|
||||||
|
Warnings:
|
||||||
|
This must be used with caution. This could lead to inconsistent node status
|
||||||
|
if the graph is still being computed.
|
||||||
|
"""
|
||||||
|
for chunk in self.alreadySubmittedChunks():
|
||||||
|
chunk.upgradeStatusTo(Status.NONE, ExecMode.NONE)
|
||||||
|
|
||||||
def upgradeStatusTo(self, newStatus):
|
def upgradeStatusTo(self, newStatus):
|
||||||
"""
|
"""
|
||||||
|
@ -1443,8 +1451,7 @@ class Graph(BaseObject):
|
||||||
def clearSubmittedNodes(self):
|
def clearSubmittedNodes(self):
|
||||||
""" Reset the status of already submitted nodes to Status.NONE """
|
""" Reset the status of already submitted nodes to Status.NONE """
|
||||||
for node in self.nodes:
|
for node in self.nodes:
|
||||||
for chunk in node.alreadySubmittedChunks():
|
node.clearSubmittedChunks()
|
||||||
chunk.upgradeStatusTo(Status.NONE, ExecMode.NONE)
|
|
||||||
|
|
||||||
def iterChunksByStatus(self, status):
|
def iterChunksByStatus(self, status):
|
||||||
""" Iterate over NodeChunks with the given status """
|
""" Iterate over NodeChunks with the given status """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue