Skip to content

Commit 9c5baab

Browse files
pipolosepipolose
pipolose
authored and
pipolose
committed
Fix of write_dot error for networkx>=1.11 in nipype/pipeline/utils.py, valid for all nx versions.
1 parent c9ababb commit 9c5baab

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import numpy as np
2828
from nipype.utils.misc import package_check
2929
from functools import reduce
30-
from distutils.version import LooseVersion
3130

3231
package_check('networkx', '1.3')
3332

@@ -1022,10 +1021,7 @@ def export_graph(graph_in, base_dir=None, show=False, use_execgraph=False,
10221021
suffix='.dot',
10231022
use_ext=False,
10241023
newpath=base_dir)
1025-
if LooseVersion(nx.__version__) < LooseVersion('1.11'):
1026-
nx.write_dot(pklgraph, outfname)
1027-
else:
1028-
nx.drawing.nx_pydot.write_dot(pklgraph, outfname)
1024+
nx.drawing.nx_pydot.write_dot(pklgraph, outfname)
10291025
logger.info('Creating dot file: %s' % outfname)
10301026
cmd = 'dot -T%s -O %s' % (format, outfname)
10311027
res = CommandLine(cmd, terminal_output='allatonce').run()

0 commit comments

Comments
 (0)