def _compile_node_creator_list(self):
graph = self._graph
cycles = list(nx.simple_cycles(graph))
if len(cycles):
raise ValueError("Found cycles in dependencies "+str(cycles))
else:
nodes = list(nx.dfs_postorder_nodes(graph))
nodes.remove(self._ROOT) # exclude root
creators = []
for n in nodes:
creator = graph.node[n].get('creator')
creators.append((n, creator))
return creators
评论列表
文章目录