Skip to content

Commit 6d6a617

Browse files
committed
fix: tests
1 parent 8e26e7f commit 6d6a617

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

nipype/interfaces/ants/registration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,10 @@ def _formatRegistration(self):
486486
for metric in self._formatMetric(ii):
487487
retval.append('--metric %s' % metric)
488488
retval.append('--convergence %s' % self._formatConvergence(ii))
489-
if self.inputs.sigma_units:
490-
retval.append('--smoothing-sigmas %s%s' % (self._antsJoinList(
491-
self.inputs.smoothing_sigmas[ii], self.inputs.sigma_units[ii])))
489+
if isdefined(self.inputs.sigma_units):
490+
retval.append('--smoothing-sigmas %s%s' %
491+
(self._antsJoinList(self.inputs.smoothing_sigmas[ii]),
492+
self.inputs.sigma_units[ii]))
492493
else:
493494
retval.append('--smoothing-sigmas %s' %
494495
self._antsJoinList(self.inputs.smoothing_sigmas[ii]))

nipype/interfaces/ants/resampling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec):
224224
exists=True)
225225
output_image = traits.Str(argstr='--output %s',
226226
desc=('output file name'), genfile=True,
227-
hash_file=False, xor=['out_postfix'])
228-
out_postfix = File("_trans", usedefault=True, hash_files=False,
229-
desc=('Postfix that is appended to all output '
230-
'files (default = _trans)'), xor=['output_image'])
227+
hash_file=False)
228+
out_postfix = traits.Str("_trans", usedefault=True,
229+
desc=('Postfix that is appended to all output '
230+
'files (default = _trans)'))
231231
reference_image = File(argstr='--reference-image %s', mandatory=True,
232232
desc='reference image space that you wish to warp INTO',
233233
exists=True)
@@ -289,7 +289,7 @@ def _gen_filename(self, name):
289289
output = self.inputs.output_image
290290
if not isdefined(output):
291291
_, name, ext = split_filename(self.inputs.input_image)
292-
output = name + '_trans' + ext
292+
output = name + self.inputs.out_postfix + ext
293293
return output
294294
return None
295295

nipype/pipeline/engine.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,10 @@ def __init__(self, interface, name, iterables=None, itersource=None,
11601160
multiprocessing pool
11611161
11621162
"""
1163-
super(Node, self).__init__(name, **kwargs)
1163+
base_dir = None
1164+
if 'base_dir' in kwargs:
1165+
base_dir = kwargs['base_dir']
1166+
super(Node, self).__init__(name, base_dir)
11641167
if interface is None:
11651168
raise IOError('Interface must be provided')
11661169
if not isinstance(interface, Interface):

nipype/pipeline/utils.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,14 @@ def synchronize_iterables(iterables):
311311
Examples
312312
--------
313313
>>> from nipype.pipeline.utils import synchronize_iterables
314-
>>> iterables = dict(a=lambda: [1, 2]), b=lambda: [3, 4])
315-
>>> synchronize_iterable_lists(iterables)
316-
[{'a': 1, 'b': 3}, {'a': 2, 'b': 4}]
317-
>>> iterables = dict(a=lambda: [1, 2]), b=lambda: [3], c=lambda: [4, 5, 6])
318-
>>> synchronize_iterable_lists(iterables)
319-
[{'a': 1, 'b': 3, 'c': 4}, {'a': 2, 'c': 5}, {'c': 6}]
314+
>>> iterables = dict(a=lambda: [1, 2], b=lambda: [3, 4])
315+
>>> synced = synchronize_iterables(iterables)
316+
>>> synced == [{'a': 1, 'b': 3}, {'a': 2, 'b': 4}]
317+
True
318+
>>> iterables = dict(a=lambda: [1, 2], b=lambda: [3], c=lambda: [4, 5, 6])
319+
>>> synced = synchronize_iterables(iterables)
320+
>>> synced == [{'a': 1, 'b': 3, 'c': 4}, {'a': 2, 'c': 5}, {'c': 6}]
321+
True
320322
"""
321323
# Convert the (field, function) tuples into (field, value) lists
322324
pair_lists = [[(field, value) for value in func()]

0 commit comments

Comments
 (0)