Skip to content

Commit 1133dc3

Browse files
chrisgorgosatra
authored andcommitted
DataGrabber does not overrides the provided template_args anymore. It
additionally sets all of the infields as a default template_args for all of the outfields.
1 parent 0967e27 commit 1133dc3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

nipype/interfaces/io.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,8 @@ class DataGrabberInputSpec(DynamicTraitedSpec): #InterfaceInputSpec):
275275
desc='Sort the filelist that matches the template')
276276
template = traits.Str(mandatory=True,
277277
desc='Layout used to get files. relative to base directory if defined')
278-
template_args = traits.Dict(traits.Str,
279-
traits.List(traits.List),
280-
value=dict(outfiles=[]), usedefault=True,
278+
template_args = traits.Dict(key_trait=traits.Str,
279+
value_trait= traits.List(traits.List),
281280
desc='Information to plug into template')
282281

283282
class DataGrabber(IOBase):
@@ -354,7 +353,6 @@ def __init__(self, infields=None, outfields=None, **kwargs):
354353
for key in infields:
355354
self.inputs.add_trait(key, traits.Any)
356355
undefined_traits[key] = Undefined
357-
self.inputs.template_args['outfiles'] = [infields]
358356
if outfields:
359357
# add ability to insert field specific templates
360358
self.inputs.add_trait('field_template',
@@ -363,9 +361,12 @@ def __init__(self, infields=None, outfields=None, **kwargs):
363361
undefined_traits['field_template'] = Undefined
364362
#self.inputs.remove_trait('template_args')
365363
outdict = {}
364+
if not isdefined(self.inputs.template_args):
365+
self.inputs.template_args = {}
366366
for key in outfields:
367-
outdict[key] = []
368-
self.inputs.template_args = outdict
367+
if not key in self.inputs.template_args:
368+
self.inputs.template_args[key] = [infields]
369+
369370
self.inputs.trait_set(trait_change_notify=False, **undefined_traits)
370371

371372
def _add_output_traits(self, base):

0 commit comments

Comments
 (0)