Skip to content

Commit 7b27198

Browse files
STY: Apply ruff/flake8-simplify rule SIM113
SIM113 Use `enumerate()` for index variable in `for` loop
1 parent d967046 commit 7b27198

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

nipype/pipeline/engine/utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1710,13 +1710,11 @@ def topological_sort(graph, depth_first=False):
17101710
logger.debug("Performing depth first search")
17111711
nodes = []
17121712
groups = []
1713-
group = 0
17141713
G = nx.Graph()
17151714
G.add_nodes_from(graph.nodes())
17161715
G.add_edges_from(graph.edges())
17171716
components = nx.connected_components(G)
1718-
for desc in components:
1719-
group += 1
1717+
for group, desc in enumerate(components, start=1):
17201718
indices = []
17211719
for node in desc:
17221720
indices.append(nodesort.index(node))

0 commit comments

Comments
 (0)