Skip to content

Commit 5bdc051

Browse files
committed
fix: fixed node configuration errors
1 parent 8415033 commit 5bdc051

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

nipype/pipeline/engine.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def __init__(self, name=None, base_dir=None, **kwargs):
143143
special characters (e.g., '.', '@').
144144
"""
145145
self.base_dir = base_dir
146-
self.config = deepcopy(config._sections)
146+
self.config = None #deepcopy(config._sections)
147147
if name is None:
148148
raise Exception("init requires a name for this %s" %
149149
self.__class__.__name__)
@@ -215,6 +215,7 @@ class Workflow(WorkflowBase):
215215
def __init__(self, *args, **kwargs):
216216
super(Workflow, self).__init__(* args, **kwargs)
217217
self._graph = nx.DiGraph()
218+
self.config = deepcopy(config._sections)
218219

219220
# PUBLIC API
220221
def clone(self, name):
@@ -1205,7 +1206,10 @@ def run(self, updatehash=False):
12051206
Update the hash stored in the output directory
12061207
"""
12071208
# check to see if output directory and hash exist
1208-
self.config = merge_dict(deepcopy(config._sections), self.config)
1209+
if self.config is None:
1210+
self.config = deepcopy(config._sections)
1211+
else:
1212+
self.config = merge_dict(deepcopy(config._sections), self.config)
12091213
if not self._got_inputs:
12101214
self._get_inputs()
12111215
self._got_inputs = True

nipype/pipeline/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ def merge_dict(d1, d2, merge=lambda x, y: y):
729729
if not isinstance(d1, dict):
730730
return merge(d1, d2)
731731
result = dict(d1)
732+
if d2 is None:
733+
return result
732734
for k, v in d2.iteritems():
733735
if k in result:
734736
result[k] = merge_dict(result[k], v, merge=merge)

0 commit comments

Comments
 (0)