Example #1
0
def __nested_remixgroup(dg1, remix_group):
    print "============= nested remix_group ================ \n"
    dg2 = nx.DiGraph()
    data = json.loads(remix_group.networkx_data)
    dg2.add_nodes_from(data['nodes'])
    dg2.add_edges_from(data['edges'])
        
    print "========== MERGED GROUP NODES: " + str(dg1.nodes())

    # FIXME: this combines the graphs correctly
    #        recheck the time-bound concept
    dg1 = nx.compose(dg1, dg2)
    print dg1.nodes()

    return dg1
Example #2
0
def create_graph():
    """Composes the graphs of the different plugins into a single graph.
    """
    # load plugins
    mgr = extension.ExtensionManager(
        namespace='doconv.converter',
        invoke_on_load=True,
        propagate_map_exceptions=True,
    )

    # check that all plugin dependencies are installed
    mgr.map_method("check_dependencies")
    # create conversion graph based on found plugins
    plugin_graphs = mgr.map_method("get_supported_conversions_graph")
    logger.debug("Loaded plugins: {0}".format(mgr.names()))

    G = nx.DiGraph()
    for graph in plugin_graphs:
        G = nx.compose(G, graph)
    return G