Skip to content

Commit eadb14f

Browse files
committed
fixing detailed graph and workflow.run().nodes() representation
1 parent 69dce12 commit eadb14f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

nipype/pipeline/engine/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def _check_inputs(self, parameter):
9595
def __str__(self):
9696
return self.fullname
9797

98+
def __repr__(self):
99+
return self.itername
100+
98101
def save(self, filename=None):
99102
if filename is None:
100103
filename = 'temp.pklz'

nipype/pipeline/engine/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def _write_detailed_dot(graph, dotfilename):
507507
# write nodes
508508
edges = []
509509
for n in nx.topological_sort(graph):
510-
nodename = str(n)
510+
nodename = str(n.itername)
511511
inports = []
512512
for u, v, d in graph.in_edges(nbunch=n, data=True):
513513
for cd in d['connect']:
@@ -519,8 +519,8 @@ def _write_detailed_dot(graph, dotfilename):
519519
ipstrip = 'in%s' % _replacefunk(inport)
520520
opstrip = 'out%s' % _replacefunk(outport)
521521
edges.append(
522-
'%s:%s:e -> %s:%s:w;' % (str(u).replace('.', ''), opstrip,
523-
str(v).replace('.', ''), ipstrip))
522+
'%s:%s:e -> %s:%s:w;' % (u.itername.replace('.', ''), opstrip,
523+
v.itername.replace('.', ''), ipstrip))
524524
if inport not in inports:
525525
inports.append(inport)
526526
inputstr = ['{IN'] + [

0 commit comments

Comments
 (0)