Skip to content

Commit d12e434

Browse files
committed
[core] Linting: Remove all trailing whitespaces
1 parent 5aca21f commit d12e434

4 files changed

Lines changed: 23 additions & 21 deletions

File tree

bin/meshroom_compute

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ if args.node:
100100
# If running as "extern", the task is supposed to have the status SUBMITTED.
101101
# If not running as "extern", the SUBMITTED status should generate a warning.
102102
submittedStatuses.append(Status.SUBMITTED)
103-
103+
104104
if not node._chunksCreated:
105105
print(f"Error: Node {node} has been submitted before chunks have been created." \
106106
"See file: \"{node.nodeStatusFile}\".")
107107
sys.exit(-1)
108-
108+
109109
if node._isInputNode():
110110
print(f"InputNode: No computation to do.")
111111

meshroom/core/desc/computation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def toDict(self):
4747
"rangeFullSize": self.fullSize,
4848
"rangeBlocksCount": self.nbBlocks
4949
}
50-
50+
5151
def __repr__(self):
5252
return f"<Range {self.iteration}({self.blockSize})/{self.nbBlocks}({self.fullSize})>"
5353

meshroom/core/node.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def loadFromCache(self, statusFile):
181181
logging.warning(f"(loadFromCache) {self.nodeName}: Error while loading status file {statusFile}: {e}")
182182
self.reset()
183183

184-
@property
184+
@property
185185
def nbChunks(self):
186186
nbBlocks = self.chunks.nbBlocks if self.chunks else -1
187187
return nbBlocks
@@ -190,15 +190,15 @@ def getChunkRanges(self):
190190
if not self.chunks:
191191
return []
192192
ranges = []
193-
for i in range(self.chunks.nbBlocks):
193+
for i in range(self.chunks.nbBlocks):
194194
ranges.append(desc.Range(
195-
iteration=i,
196-
blockSize=self.chunks.blockSize,
197-
fullSize=self.chunks.fullSize,
195+
iteration=i,
196+
blockSize=self.chunks.blockSize,
197+
fullSize=self.chunks.fullSize,
198198
nbBlocks=self.chunks.nbBlocks
199199
))
200200
return ranges
201-
201+
202202
def setChunks(self, chunks):
203203
blockSize, fullSize, nbBlocks = 1, 1, 1
204204
for c in chunks:
@@ -268,7 +268,7 @@ def reset(self):
268268
self.mrNodeType: MrNodeType = MrNodeType.NONE
269269
self.execMode: ExecMode = ExecMode.NONE
270270
self.resetDynamicValues()
271-
271+
272272
def initStartCompute(self):
273273
import platform
274274
self.computeSessionUid = meshroom.core.sessionUid
@@ -504,12 +504,14 @@ def logger(self):
504504

505505
def getExecModeName(self):
506506
return self._status.execMode.name
507-
507+
508508
def shouldMonitorChanges(self):
509-
""" Check whether we should monitor changes in minimal mode
509+
"""
510+
Check whether we should monitor changes in minimal mode.
510511
Only chunks that are run externally or local_isolated should be monitored,
511512
when run locally, status changes are already notified.
512-
Chunks with an ERROR status may be re-submitted externally and should thus still be monitored
513+
Chunks with an ERROR status may be re-submitted externally and should thus still be
514+
monitored.
513515
"""
514516
return (self.isExtern() and self._status.status in (Status.SUBMITTED, Status.RUNNING, Status.ERROR)) or \
515517
(self.node.getMrNodeType() == MrNodeType.NODE and self._status.status in (Status.SUBMITTED, Status.RUNNING))
@@ -520,7 +522,7 @@ def updateStatusFromCache(self):
520522
"""
521523
# TODO : If this is a placeholder chunk
522524
# Then we shouldn't do anything here
523-
525+
524526
statusFile = self.getStatusFile()
525527
oldStatus = self._status.status
526528
# No status file => reset status to Status.None
@@ -824,7 +826,7 @@ def __init__(self, nodeType: str, position: Position = None, parent: BaseObject
824826
self._locked: bool = False
825827
self._duplicates = ListModel(parent=self) # list of nodes with the same uid
826828
self._hasDuplicates: bool = False
827-
829+
828830
self._nodeStatus: NodeStatusData = NodeStatusData(self._name, nodeType, self.packageName,
829831
self.packageVersion, self.getMrNodeType())
830832
self.nodeStatusFileLastModTime = -1
@@ -1510,9 +1512,9 @@ def sourceCodeFolder(self):
15101512
@property
15111513
def nodeStatusFile(self):
15121514
return os.path.join(self.graph.cacheDir, self.internalFolder, "nodeStatus")
1513-
1515+
15141516
def shouldMonitorChanges(self):
1515-
""" Check whether we should monitor changes in minimal mode
1517+
""" Check whether we should monitor changes in minimal mode.
15161518
Only chunks that are run externally or local_isolated should be monitored,
15171519
when run locally, status changes are already notified.
15181520
Chunks with an ERROR status may be re-submitted externally and should thus still be monitored
@@ -2191,7 +2193,7 @@ def toDict(self):
21912193
}
21922194

21932195
def _resetChunks(self):
2194-
""" Set chunks on the node
2196+
""" Set chunks on the node
21952197
# TODO : Maybe don't delete chunks if we will recreate them as before ?
21962198
"""
21972199
if isinstance(self.nodeDesc, desc.InputNode):
@@ -2230,7 +2232,7 @@ def _resetChunks(self):
22302232
self._chunksCreated = False
22312233
self.setSize(0)
22322234
self._chunks.setObjectList([])
2233-
# Create chunks when possible
2235+
# Create chunks when possible
22342236
self.chunksCreatedChanged.emit()
22352237
self.chunksChanged.emit()
22362238
self.globalStatusChanged.emit()

meshroom/core/submitter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __repr__(self):
8282
# For all methods if If iteration is -1 then it kills all the tasks for the given node
8383

8484
def stopChunkTask(self, node, iteration):
85-
""" This will kill one task
85+
""" This will kill one task.
8686
If iteration is -1 then it kills all the tasks for the given node
8787
"""
8888
if self.submitterOptions.includes(SubmitterOptionsEnum.INTERRUPT_JOB):
@@ -233,7 +233,7 @@ def killRunningJob():
233233
killed by a user that don't want his machine to be used. Unfortunately this
234234
means jobs will be launched twice even if they failed for a good reason.
235235
This function can be used to make sure the current job will not restart
236-
Note : the ERROR_NO_RETRY itself won't do anything. This function must be
236+
Note : the ERROR_NO_RETRY itself won't do anything. This function must be
237237
implemented on a case-by-case for each possible farm system
238238
"""
239239
sys.exit(meshroom.MeshroomExitStatus.ERROR_NO_RETRY)

0 commit comments

Comments
 (0)