@@ -845,9 +845,9 @@ def __init__(self, nodeType: str, position: Position = None, parent: BaseObject
845845 self .dirty : bool = True # whether this node's outputs must be re-evaluated on next Graph update
846846 self ._chunks : list [NodeChunk ] = ListModel (parent = self )
847847 self ._preprocessChunk = NodeChunk (self , desc .Range (ChunkIndex .PREPROCESS )) if \
848- self .nodeDesc and self .nodeDesc ._hasPreprocess else None
848+ self .nodeDesc and self .nodeDesc .hasPreprocess else None
849849 self ._postprocessChunk = NodeChunk (self , desc .Range (ChunkIndex .POSTPROCESS )) if \
850- self .nodeDesc and self .nodeDesc ._hasPostprocess else None
850+ self .nodeDesc and self .nodeDesc .hasPostprocess else None
851851 self ._chunksCreated = False # Only initialize chunks on compute
852852 self ._chunkPlaceholder : list [NodeChunk ] = ListModel (parent = self ) # Placeholder chunk for nodes with dynamic ones
853853 self ._uid : str = uid
@@ -1468,9 +1468,9 @@ def clearLocallySubmittedChunks(self):
14681468
14691469 def upgradeStatusTo (self , newStatus , execMode = None ):
14701470 """ Upgrade node to the given status and save it on disk. """
1471- if self .nodeDesc ._hasPreprocess :
1471+ if self .nodeDesc .hasPreprocess :
14721472 self ._preprocessChunk .upgradeStatusTo (newStatus )
1473- if self .nodeDesc ._hasPostprocess :
1473+ if self .nodeDesc .hasPostprocess :
14741474 self ._postprocessChunk .upgradeStatusTo (newStatus )
14751475 if self ._chunksCreated :
14761476 for chunk in self ._chunks :
@@ -1674,9 +1674,9 @@ def updateStatusFromCache(self):
16741674 logging .warning (f"Could not create chunks from cache: { e } " )
16751675 return
16761676 s = self .globalStatus
1677- if self .nodeDesc ._hasPreprocess :
1677+ if self .nodeDesc .hasPreprocess :
16781678 self ._preprocessChunk .updateStatusFromCache ()
1679- if self .nodeDesc ._hasPostprocess :
1679+ if self .nodeDesc .hasPostprocess :
16801680 self ._postprocessChunk .updateStatusFromCache ()
16811681 if self ._chunksCreated :
16821682 for chunk in self ._chunks :
@@ -1780,7 +1780,7 @@ def processIteration(self, iteration):
17801780
17811781 def preprocess (self , forceCompute = False , inCurrentEnv = False ):
17821782 """ Prepare the node processing """
1783- if self .nodeDesc ._hasPreprocess :
1783+ if self .nodeDesc .hasPreprocess :
17841784 self .prepareLogger (ChunkIndex .PREPROCESS )
17851785 self ._preprocessChunk .process (forceCompute , inCurrentEnv )
17861786 self .restoreLogger ()
@@ -1794,7 +1794,7 @@ def postprocess(self, forceCompute=False, inCurrentEnv=False):
17941794 Invoke the post process on Client Node to execute after the processing on the
17951795 node is completed
17961796 """
1797- if self .nodeDesc ._hasPostprocess :
1797+ if self .nodeDesc .hasPostprocess :
17981798 self .prepareLogger (ChunkIndex .POSTPROCESS )
17991799 self ._postprocessChunk .process (forceCompute , inCurrentEnv )
18001800 self .restoreLogger ()
@@ -1904,9 +1904,9 @@ def endSequence(self):
19041904
19051905 def stopComputation (self ):
19061906 """ Stop the computation of this node. """
1907- if self .nodeDesc ._hasPreprocess :
1907+ if self .nodeDesc .hasPreprocess :
19081908 self ._preprocessChunk .stopProcess ()
1909- if self .nodeDesc ._hasPostprocess :
1909+ if self .nodeDesc .hasPostprocess :
19101910 self ._postprocessChunk .stopProcess ()
19111911 if self ._chunks :
19121912 for chunk in self ._chunks .values ():
@@ -2002,19 +2002,19 @@ def getChunks(self) -> list[NodeChunk]:
20022002 @property
20032003 def _allChunks (self ) -> list [NodeChunk ]:
20042004 chunks = []
2005- if self .nodeDesc ._hasPreprocess :
2005+ if self .nodeDesc .hasPreprocess :
20062006 chunks .append (self ._preprocessChunk )
20072007 chunks .extend ([c for c in self ._chunks ])
2008- if self .nodeDesc ._hasPostprocess :
2008+ if self .nodeDesc .hasPostprocess :
20092009 chunks .append (self ._postprocessChunk )
20102010 return chunks
20112011
20122012 def getAllChunks (self ):
20132013 allChunks = []
2014- if self .nodeDesc ._hasPreprocess :
2014+ if self .nodeDesc .hasPreprocess :
20152015 allChunks .append ({"chunkIndex" : ChunkIndex .PREPROCESS , "chunk" : self ._preprocessChunk , "name" : "Preprocess" })
20162016 allChunks .extend ([{"chunkIndex" : i , "chunk" : c , "name" : str (i )} for i , c in enumerate (self ._chunks )])
2017- if self .nodeDesc ._hasPostprocess :
2017+ if self .nodeDesc .hasPostprocess :
20182018 allChunks .append ({"chunkIndex" : ChunkIndex .POSTPROCESS , "chunk" : self ._postprocessChunk , "name" : "Postprocess" })
20192019 return allChunks
20202020
@@ -2277,6 +2277,8 @@ def _hasDisplayableShape(self):
22772277 chunksCreated = Property (bool , lambda self : self ._chunksCreated , notify = chunksCreatedChanged )
22782278 chunksChanged = Signal ()
22792279 chunks = Property (Variant , getChunks , notify = chunksChanged )
2280+ preprocessChunk = Property (Variant , lambda self : self ._preprocessChunk , notify = chunksChanged )
2281+ postprocessChunk = Property (Variant , lambda self : self ._postprocessChunk , notify = chunksChanged )
22802282 allChunks = Property (Variant , getAllChunks , notify = chunksChanged )
22812283 chunkPlaceholder = Property (Variant , lambda self : self ._chunkPlaceholder , notify = chunksChanged )
22822284 nbParallelizationBlocks = Property (int , lambda self : len (self ._chunks ) if self ._chunksCreated else 0 , notify = chunksChanged )
@@ -2470,12 +2472,12 @@ def _resetChunks(self):
24702472 self .setSize (0 )
24712473 self ._chunkPlaceholder .setObjectList ([NodeChunk (self , desc .computation .Range ())])
24722474 # Pre/post process
2473- if self .nodeDesc ._hasPreprocess :
2475+ if self .nodeDesc .hasPreprocess :
24742476 self ._preprocessChunk = NodeChunk (self , desc .Range (ChunkIndex .PREPROCESS ))
24752477 self ._preprocessChunk .statusChanged .connect (self .globalStatusChanged )
24762478 else :
24772479 self ._preprocessChunk = None
2478- if self .nodeDesc ._hasPostprocess :
2480+ if self .nodeDesc .hasPostprocess :
24792481 self ._postprocessChunk = NodeChunk (self , desc .Range (ChunkIndex .POSTPROCESS ))
24802482 self ._postprocessChunk .statusChanged .connect (self .globalStatusChanged )
24812483 else :
0 commit comments