api/csv_to_graph.py
def convert_edges(edges, idmap):
    """Convert the edge ids read from the csv file to their vertex id
    equivalents. This is necessary because igraph assigns its own vertex ids
    rather than using the ones used to add edges.
    :param iterator edges: An iterable for the edges to be converted. Should be
        (src, target) tuples
    :param dict idmap: Keys should be edges as they are read from the csv files,
        and values should be vertex ids as assigned by igraph during
        `add_vertices`.
    """
    for e1, e2 in edges:
        try:
            src = idmap[e1]
        except KeyError:
            logging.error('edge src id not present in id file: %s' % e1)
            continue
        try:
            target = idmap[e2]
        except KeyError:
            logging.error('edge target id not present in id file: %s' % e2)
            continue

        yield (src, target)
Convert the edge ids read from the csv file to their vertex id
    equivalents. This is necessary because igraph assigns its own vertex ids
    rather than using the ones used to add edges.
    :param iterator edges: An iterable for the edges to be converted. Should be
        (src, target) tuples
    :param dict idmap: Keys should be edges as they are read from the csv files,
        and values should be vertex ids as assigned by igraph during
        `add_vertices`.
    
Convert the edge ids read from the csv file to their vertex id
equivalents. This is necessary because igraph assigns its own vertex ids
rather than using the ones used to add edges.
Convert the edge ids read from the csv file to their vertex id equivalents . This is necessary because igraph assigns its own vertex ids rather than using the ones used to add edges .
def convert_edges(edges, idmap):
    for e1, e2 in edges:
        try:
            src = idmap[e1]
        except KeyError:
            logging.error('edge src id not present in id file: %s' % e1)
            continue
        try:
            target = idmap[e2]
        except KeyError:
            logging.error('edge target id not present in id file: %s' % e2)
            continue
        yield (src, target)
def convert_edges ( edges , idmap ) : for e1 , e2 in edges : try : src = idmap [ e1 ] except KeyError : logging . error ( 'edge src id not present in id file: %s' % e1 ) continue try : target = idmap [ e2 ] except KeyError : logging . error ( 'edge target id not present in id file: %s' % e2 ) continue yield ( src , target )
Convert the edge ids read from the csv file to their vertex id
equivalents.
Convert the edge ids read from the csv file to their vertex id equivalents .
"""Convert the edge ids read from the csv file to their vertex id
    equivalents. This is necessary because igraph assigns its own vertex ids
    rather than using the ones used to add edges.
    :param iterator edges: An iterable for the edges to be converted. Should be
        (src, target) tuples
    :param dict idmap: Keys should be edges as they are read from the csv files,
        and values should be vertex ids as assigned by igraph during
        `add_vertices`.
    """
edges
An iterable for the edges to be converted. Should be
(src, target) tuples
An iterable for the edges to be converted . Should be ( src target ) tuples
idmap
Keys should be edges as they are read from the csv files,
and values should be vertex ids as assigned by igraph during
`add_vertices`.
Keys should be edges as they are read from the csv files and values should be vertex ids as assigned by igraph during ` add_vertices ` .