Skip to content

Commit 431be35

Browse files
committed
moving itername and _id from Node to EngineBase
1 parent eadb14f commit 431be35

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

nipype/pipeline/engine/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(self, name=None, base_dir=None):
4141
self.base_dir = base_dir
4242
self.config = deepcopy(config._sections)
4343
self.name = name
44+
self._id = self.name # for compatibility with node expansion using iterables
4445

4546
@property
4647
def name(self):
@@ -66,6 +67,14 @@ def inputs(self):
6667
def outputs(self):
6768
raise NotImplementedError
6869

70+
@property
71+
def itername(self):
72+
"""Name for expanded iterable"""
73+
itername = self._id
74+
if self._hierarchy:
75+
itername = '%s.%s' % (self._hierarchy, self._id)
76+
return itername
77+
6978
def clone(self, name):
7079
"""Clone an EngineBase object
7180

nipype/pipeline/engine/nodes.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def __init__(self,
159159
self._got_inputs = False
160160
self._originputs = None
161161
self._output_dir = None
162-
self._id = self.name # for compatibility with node expansion using iterables
163162

164163
self.iterables = iterables
165164
self.synchronize = synchronize
@@ -249,14 +248,6 @@ def n_procs(self, value):
249248
if hasattr(self._interface.inputs, 'num_threads'):
250249
self._interface.inputs.num_threads = self._n_procs
251250

252-
@property
253-
def itername(self):
254-
"""Name for expanded iterable"""
255-
itername = self._id
256-
if self._hierarchy:
257-
itername = '%s.%s' % (self._hierarchy, self._id)
258-
return itername
259-
260251
def output_dir(self):
261252
"""Return the location of the output directory for the node"""
262253
# Output dir is cached

0 commit comments

Comments
 (0)