project: Refactor pipeline

What's a pipeline if not the weekly connected component subgraphs of a
directed acyclic graph?
This commit is contained in:
Mr. Outis
2018-12-13 13:37:45 -06:00
parent 286373f9c7
commit cb142f9f0e
+1 -19
View File
@@ -1180,25 +1180,7 @@ class Project(object):
G, G_active = self.graph()
if len(G.nodes()) == 0:
return []
# find pipeline ends aka "output stages"
ends = [node for node, in_degree in G.in_degree() if in_degree == 0]
# filter out subgraphs that didn't exist in original G
pipelines = []
for c in nx.weakly_connected_components(G_active):
H = G_active.subgraph(c)
found = False
for node in ends:
if node in H:
found = True
break
if found:
pipelines.append(H)
return pipelines
return list(nx.weakly_connected_component_subgraphs(G_active))
def stages(self):
"""