def compute_relevant(tag): load_graph() ancestors_full, ancestors_shortcut = graphs.get_ancestors(db.graph, tag) descendants_full, descendants_shortcut = graphs.get_descendants(db.graph, tag) relevant_full = set([tag]).union(ancestors_full).union(descendants_full) relevant_shortcut = ancestors_shortcut.union(descendants_shortcut).difference(relevant_full) return relevant_full, relevant_shortcut
def compute_relevant(tag): load_graph() ancestors_full, ancestors_shortcut = graphs.get_ancestors(db.graph, tag) descendants_full, descendants_shortcut = graphs.get_descendants( db.graph, tag) relevant_full = set([tag]).union(ancestors_full).union(descendants_full) relevant_shortcut = ancestors_shortcut.union( descendants_shortcut).difference(relevant_full) return relevant_full, relevant_shortcut
def compute_dependencies(tags): load_graph() full, short = set(), set() for tag in tags: curr_full, curr_short = graphs.get_ancestors(db.graph, tag) full.update(curr_full) short.update(curr_short) full = set([tag]).union(full) short = short.difference(full) return full, short