Skip to content

Commit d4e9049

Browse files
committed
Fix calls to clean_queue to make sure that the info about exceptions is always there
1 parent 9eaa2a3 commit d4e9049

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_AntsJointFusion_inputs():
5757
hash_files=False,
5858
),
5959
out_label_post_prob_name_format=dict(
60-
requires=['out_label_fusion', 'out_intensity_fusion_name_format'],
61-
),
60+
requires=['out_label_fusion',
61+
'out_intensity_fusion_name_format'], ),
6262
patch_metric=dict(argstr='-m %s', ),
6363
patch_radius=dict(
6464
argstr='-p %s',
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..reporting import ReportCapableInterface
4+
5+
6+
def test_ReportCapableInterface_inputs():
7+
input_map = dict(
8+
ignore_exception=dict(
9+
deprecated='1.0.0',
10+
nohash=True,
11+
usedefault=True,
12+
), )
13+
inputs = ReportCapableInterface.input_spec()
14+
15+
for key, metadata in list(input_map.items()):
16+
for metakey, value in list(metadata.items()):
17+
assert getattr(inputs.traits()[key], metakey) == value

nipype/pipeline/plugins/base.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
292292
try:
293293
num_subnodes = self.procs[jobid].num_subnodes()
294294
except Exception:
295-
self._clean_queue(jobid, graph)
295+
self._clean_queue(jobid, graph,
296+
result={
297+
'result': None,
298+
'traceback': '\n'.join(format_exception(*sys.exc_info()))
299+
})
296300
self.proc_pending[jobid] = False
297301
continue
298302
if num_subnodes > 1:
@@ -315,7 +319,11 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
315319
try:
316320
self.procs[jobid].run()
317321
except Exception:
318-
self._clean_queue(jobid, graph)
322+
self._clean_queue(jobid, graph,
323+
result={
324+
'result': None,
325+
'traceback': '\n'.join(format_exception(*sys.exc_info()))
326+
})
319327
self._task_finished_cb(jobid)
320328
self._remove_node_dirs()
321329
else:
@@ -369,7 +377,12 @@ def _local_hash_check(self, jobid, graph):
369377
logger.debug('Error skipping cached node %s (%s).\n\n%s',
370378
self.procs[jobid], jobid,
371379
'\n'.join(format_exception(*sys.exc_info())))
372-
self._clean_queue(jobid, graph)
380+
self._clean_queue(jobid, graph,
381+
result={
382+
'result': None,
383+
'traceback': '\n'.join(format_exception(*sys.exc_info()))
384+
})
385+
373386
self.proc_pending[jobid] = False
374387
return True
375388
return False

0 commit comments

Comments
 (0)