Skip to content

Commit 3fa52a9

Browse files
Remove topological sort for _generate_flatgraph
- The function is only adding/removing nodes and adjusting their connections - As such, there are no serial dependencies, and we can iterate in any order
1 parent e9fb94e commit 3fa52a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nipype/pipeline/engine/workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def _generate_flatgraph(self):
970970
raise Exception(
971971
("Workflow: %s is not a directed acyclic graph " "(DAG)") % self.name
972972
)
973-
nodes = list(nx.topological_sort(self._graph))
973+
nodes = list(self._graph.nodes)
974974
for node in nodes:
975975
logger.debug("processing node: %s", node)
976976
if isinstance(node, Workflow):

0 commit comments

Comments
 (0)