Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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