Commit 4fe6fbb2 authored by dirk.wintergruen's avatar dirk.wintergruen
Browse files

addedMethod from

parent 05adafd0
......@@ -193,8 +193,9 @@ class MultiLayerGraph(OrderedDict):
"""
if format:
tmp_gr = igraph.load(fn,format="graphml")
tmp_gr = igraph.load(fn)
tmp_gr = igraph.load(fn,format=format)
else:
tmp_gr = igraph.load(fn)
gr = cls()
for n in tmp_gr.vs:
gr.add_vertex(**n.attributes())
......@@ -203,7 +204,15 @@ class MultiLayerGraph(OrderedDict):
return gr
@classmethod
def fromGraph(cls,tmp_gr):
gr = cls()
for n in tmp_gr.vs:
gr.add_vertex(**n.attributes())
for n in tmp_gr.es:
gr.add_edge(n.source, n.target, **n.attributes())
return gr
class JoinedMultiLayerGraph(igraph.Graph):
"""
......
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