Commit 05adafd0 authored by dirk.wintergruen's avatar dirk.wintergruen
Browse files

more debug

parent 957965b6
__version__ = "0.9.6.3"
__version__ = "0.9.6.4"
......@@ -191,11 +191,24 @@ def union(g_1, g_2, v_attr_name,e_attr_name = None, typ_field = None):
#graph_merged.es[a]=[mergedEdges[e][a] for e in mergedEdgesList]
logger.debug("now we add_edges")
edges_list_new = []
attributes = defaultdict(list)
#for performance reasons - first we generate lists
for e,n_vs in tqdm(add_edges.items()):
for k,vs in n_vs.items():
d = {x:y for x,y in vs}
graph_merged.add_edge(e[0],e[1],**d)
edges_list_new.append((e[0],e[1]))
attributes[d].append(y)
# d = {x:y for x,y in vs}
# graph_merged.add_edge(e[0],e[1],**d)
#now we add the edges
graph_merged.add_edges(edges_list_new)
#now the attributes
for d,attr_list in attributes.items():
graph_merged.es[d].extend(attr_list)
if len(graph_merged.vs) == 0:
graph_merged.add_vertices(v_attr_merged)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment