@@ -96,7 +96,7 @@ def reset(self):
9696 self .resetDynamicValues ()
9797
9898 def resetChunkInfo (self ):
99- self .chunks : NodeChunkSetup = None
99+ self .chunksSetup : NodeChunkSetup = None
100100
101101 def resetDynamicValues (self ):
102102 self .status : Status = Status .NONE
@@ -157,10 +157,10 @@ def toDict(self):
157157 for _k , _v in d .items ():
158158 if isinstance (_v , Enum ):
159159 d [_k ] = _v .name
160- if self .chunks and self .chunks .nbBlocks > 0 :
161- d ["chunksBlockSize" ] = self .chunks .blockSize
162- d ["chunksFullSize" ] = self .chunks .fullSize
163- d ["chunksNbBlocks" ] = self .chunks .nbBlocks
160+ if self .chunksSetup and self .chunksSetup .nbBlocks > 0 :
161+ d ["chunksBlockSize" ] = self .chunksSetup .blockSize
162+ d ["chunksFullSize" ] = self .chunksSetup .fullSize
163+ d ["chunksNbBlocks" ] = self .chunksSetup .nbBlocks
164164 else :
165165 # Ensure we do not write chunk keys with zero/invalid values,
166166 # as they would create a poisoned NodeChunkSetup(0,0,0) on reload
@@ -178,7 +178,7 @@ def fromDict(self, d):
178178 fullSize = int (d .pop ("chunksFullSize" ) or 0 )
179179 nbBlocks = int (d .pop ("chunksNbBlocks" ) or 0 )
180180 if nbBlocks > 0 :
181- self .chunks = NodeChunkSetup (blockSize , fullSize , nbBlocks )
181+ self .chunksSetup = NodeChunkSetup (blockSize , fullSize , nbBlocks )
182182 if "status" in d :
183183 self .status : Status = Status [d .pop ("status" )]
184184 if "execMode" in d :
@@ -199,24 +199,24 @@ def loadFromCache(self, statusFile):
199199
200200 @property
201201 def nbChunks (self ):
202- nbBlocks = self .chunks .nbBlocks if self .chunks else - 1
202+ nbBlocks = self .chunksSetup .nbBlocks if self .chunksSetup else - 1
203203 return nbBlocks
204204
205205 @property
206206 def fullSize (self ):
207- fullSize = self .chunks .fullSize if self .chunks else - 1
207+ fullSize = self .chunksSetup .fullSize if self .chunksSetup else - 1
208208 return fullSize
209209
210210 def getChunkRanges (self ):
211- if not self .chunks :
211+ if not self .chunksSetup :
212212 return []
213213 ranges = []
214- for i in range (self .chunks .nbBlocks ):
214+ for i in range (self .chunksSetup .nbBlocks ):
215215 ranges .append (desc .Range (
216216 iteration = i ,
217- blockSize = self .chunks .blockSize ,
218- fullSize = self .chunks .fullSize ,
219- nbBlocks = self .chunks .nbBlocks
217+ blockSize = self .chunksSetup .blockSize ,
218+ fullSize = self .chunksSetup .fullSize ,
219+ nbBlocks = self .chunksSetup .nbBlocks
220220 ))
221221 return ranges
222222
@@ -226,7 +226,7 @@ def setChunks(self, chunks):
226226 r = c .range
227227 blockSize , fullSize , nbBlocks = r .blockSize , r .fullSize , r .nbBlocks
228228 break
229- self .chunks = NodeChunkSetup (blockSize , fullSize , nbBlocks )
229+ self .chunksSetup = NodeChunkSetup (blockSize , fullSize , nbBlocks )
230230
231231
232232class ChunkStatusData (BaseObject ):
@@ -1644,9 +1644,9 @@ def updateNodeStatusFromCache(self):
16441644 """
16451645 chunksRangeHasChanged = False
16461646 if os .path .exists (self .nodeStatusFile ):
1647- oldChunkSetup = self ._nodeStatus .chunks
1647+ oldChunkSetup = self ._nodeStatus .chunksSetup
16481648 self ._nodeStatus .loadFromCache (self .nodeStatusFile )
1649- if self ._nodeStatus .chunks != oldChunkSetup :
1649+ if self ._nodeStatus .chunksSetup != oldChunkSetup :
16501650 chunksRangeHasChanged = True
16511651 self .nodeStatusFileLastModTime = os .path .getmtime (self .nodeStatusFile )
16521652 else :
0 commit comments