Commit c2476109 authored by dirk.wintergruen's avatar dirk.wintergruen
Browse files

error handling if not edge list can be generated

parent 40011e2c
...@@ -3,21 +3,9 @@ import igraph ...@@ -3,21 +3,9 @@ import igraph
import math import math
import matplotlib.patches as mpatches import matplotlib.patches as mpatches
from builtins import str from builtins import str
import matplotlib
import tempfile import tempfile
import os import os
import sys
# from network_extensions.igraph_redis import ExtendedRedisGraph
# from network_extensions.ExtendedGraph import ExtendedGraph
# from network_extensions.ExtendedGraph import ExtendedGraph
# try: #TODO improve this handling
# matplotlib.use("MacOSX")
# from matplotlib import pylab
# except:
# matplotlib.use("ps")
# from matplotlib import pylab
import tarfile import tarfile
import re import re
...@@ -95,9 +83,14 @@ def get_edgelist(g, attrs, v_attr): ...@@ -95,9 +83,14 @@ def get_edgelist(g, attrs, v_attr):
attrL = [s, t] + [(v, getA(e, v, "")) for v in attrs] attrL = [s, t] + [(v, getA(e, v, "")) for v in attrs]
ret.append(tuple(attrL)) ret.append(tuple(attrL))
try: try:
return set(ret) if len(ret) > 0:
return set(ret)
return set()
except: except:
print("ERROR") logging.error(f"ERROR: couldn't create the edge List {sys.exc_info()}")
logging.error("Will return an empty set!")
return set()
def get_merged_edge_list(ml): def get_merged_edge_list(ml):
Supports Markdown
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