Skip to content

Commit 1c16fca

Browse files
committed
updating to networkx ver.2 (dev): add_edge doesnt have attr_dict anymore (so changed to **dict); some updates related to changes in .nodes method (its not a list anymore)
1 parent 6f574b0 commit 1c16fca

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ def make_field_func(*pair):
847847
logger.debug("Qualified the %s -> %s join field"
848848
" %s as %s." %
849849
(in_node, jnode, dest_field, slot_field))
850-
graph_in.add_edge(in_node, jnode, newdata)
850+
graph_in.add_edge(in_node, jnode, **newdata)
851851
logger.debug("Connected the join node %s subgraph to the"
852852
" expanded join point %s" % (jnode, in_node))
853853

@@ -1289,8 +1289,8 @@ def write_workflow_prov(graph, filename=None, format='all'):
12891289
# add dependencies (edges)
12901290
# Process->Process
12911291
for idx, edgeinfo in enumerate(graph.in_edges()):
1292-
ps.g.wasStartedBy(processes[nodes.index(edgeinfo[1])],
1293-
starter=processes[nodes.index(edgeinfo[0])])
1292+
ps.g.wasStartedBy(processes[list(nodes).index(edgeinfo[1])],
1293+
starter=processes[list(nodes).index(edgeinfo[0])])
12941294

12951295
# write provenance
12961296
ps.write_provenance(filename, format=format)

nipype/pipeline/plugins/tests/test_linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ def test_run_in_series(tmpdir):
4141
mod1.inputs.input1 = 1
4242
execgraph = pipe.run(plugin="Linear")
4343
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
44-
node = execgraph.nodes()[names.index('pipe.mod1')]
44+
node = list(execgraph.nodes())[names.index('pipe.mod1')]
4545
result = node.get_output('output1')
4646
assert result == [1, 1]

nipype/pipeline/plugins/tests/test_multiproc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_run_multiproc(tmpdir):
4646
pipe.config['execution']['poll_sleep_duration'] = 2
4747
execgraph = pipe.run(plugin="MultiProc")
4848
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
49-
node = execgraph.nodes()[names.index('pipe.mod1')]
49+
node = list(execgraph.nodes())[names.index('pipe.mod1')]
5050
result = node.get_output('output1')
5151
assert result == [1, 1]
5252

nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def run_multiproc_nondaemon_with_flag(nondaemon_flag):
123123
'non_daemon': nondaemon_flag})
124124

125125
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
126-
node = execgraph.nodes()[names.index('pipe.f2')]
126+
node = list(execgraph.nodes())[names.index('pipe.f2')]
127127
result = node.get_output('sum_out')
128128
os.chdir(cur_dir)
129129
rmtree(temp_dir)

nipype/pipeline/plugins/tests/test_oar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_run_oar():
5050
'.'.join((node._hierarchy, node.name))
5151
for node in execgraph.nodes()
5252
]
53-
node = execgraph.nodes()[names.index('pipe.mod1')]
53+
node = list(execgraph.nodes())[names.index('pipe.mod1')]
5454
result = node.get_output('output1')
5555
assert result == [1, 1]
5656
os.chdir(cur_dir)

nipype/pipeline/plugins/tests/test_pbs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_run_pbsgraph():
4848
mod1.inputs.input1 = 1
4949
execgraph = pipe.run(plugin="PBSGraph")
5050
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
51-
node = execgraph.nodes()[names.index('pipe.mod1')]
51+
node = list(execgraph.nodes())[names.index('pipe.mod1')]
5252
result = node.get_output('output1')
5353
assert result == [1, 1]
5454
os.chdir(cur_dir)

nipype/pipeline/plugins/tests/test_somaflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ def test_run_somaflow(tmpdir):
4646
mod1.inputs.input1 = 1
4747
execgraph = pipe.run(plugin="SomaFlow")
4848
names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
49-
node = execgraph.nodes()[names.index('pipe.mod1')]
49+
node = list(execgraph.nodes())[names.index('pipe.mod1')]
5050
result = node.get_output('output1')
5151
assert result == [1, 1]

0 commit comments

Comments
 (0)