Skip to content

Commit 0561308

Browse files
committed
improve message, fix error in logging
1 parent 4148881 commit 0561308

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _submit_mapnode(self, jobid):
244244
mapnodesubids = self.procs[jobid].get_subnodes()
245245
numnodes = len(mapnodesubids)
246246
logger.debug('Adding %d jobs for mapnode %s', numnodes,
247-
self.procs[jobid]._id)
247+
self.procs[jobid].fullname)
248248
for i in range(numnodes):
249249
self.mapnodesubids[self.depidx.shape[0] + i] = jobid
250250
self.procs.extend(mapnodesubids)
@@ -274,7 +274,7 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
274274
slots = None
275275
else:
276276
slots = max(0, self.max_jobs - num_jobs)
277-
logger.debug('Slots available: %s' % slots)
277+
logger.debug('Slots available: %s', slots)
278278
if (num_jobs >= self.max_jobs) or (slots == 0):
279279
break
280280

@@ -303,14 +303,14 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
303303
self.proc_done[jobid] = True
304304
self.proc_pending[jobid] = True
305305
# Send job to task manager and add to pending tasks
306-
logger.info('Submitting: %s ID: %d' %
307-
(self.procs[jobid]._id, jobid))
306+
logger.info('Submitting: %s ID: %d',
307+
self.procs[jobid]._id, jobid)
308308
if self._status_callback:
309309
self._status_callback(self.procs[jobid], 'start')
310310

311311
if not self._local_hash_check(jobid, graph):
312312
if self.procs[jobid].run_without_submitting:
313-
logger.debug('Running node %s on master thread' %
313+
logger.debug('Running node %s on master thread',
314314
self.procs[jobid])
315315
try:
316316
self.procs[jobid].run()
@@ -328,7 +328,7 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
328328
else:
329329
self.pending_tasks.insert(0, (tid, jobid))
330330
logger.info('Finished submitting: %s ID: %d',
331-
(self.procs[jobid]._id, jobid))
331+
self.procs[jobid]._id, jobid)
332332
else:
333333
break
334334

@@ -340,12 +340,17 @@ def _local_hash_check(self, jobid, graph):
340340
try:
341341
cached, updated = self.procs[jobid].is_cached()
342342
except Exception:
343-
logger.warning('Error while checking node hash, forcing re-run. '
344-
'Although this error may not prevent the workflow from running, '
345-
'it could indicate a major problem. Please report a new issue'
346-
'at https://github.com/nipy/nipype/issues adding the following'
347-
'information:\n\n%s',
348-
'\n'.join(format_exception(*sys.exc_info())))
343+
logger.warning(
344+
'Error while checking node hash, forcing re-run. '
345+
'Although this error may not prevent the workflow from running, '
346+
'it could indicate a major problem. Please report a new issue'
347+
'at https://github.com/nipy/nipype/issues adding the following'
348+
'information:\n\n\tNode: %s\n\tInterface: %s.%s\n\tTraceback:\n%s',
349+
self.procs[jobid].fullname,
350+
self.procs[jobid].interface.__module__,
351+
self.procs[jobid].interface.__class__.__name__,
352+
'\n'.join(format_exception(*sys.exc_info()))
353+
)
349354
return False
350355

351356
logger.debug('Checking hash "%s" locally: cached=%s, updated=%s.',

0 commit comments

Comments
 (0)