def remove_ancestors_of(self, node):
"""Remove all of the ancestor operation nodes of node."""
anc = nx.ancestors(self.multi_graph, node)
# TODO: probably better to do all at once using
# multi_graph.remove_nodes_from; same for related functions ...
for n in anc:
nd = self.multi_graph.node[n]
if nd["type"] == "op":
self._remove_op_node(n)
评论列表
文章目录