diff --git a/Analysis/report_graph.py b/Analysis/report_graph.py index 734ee5a33ece19687ba8a50949be6e8070acdc94..85ddb3dd0f08a5381fd253198c27e8e9af0b1d08 100755 --- a/Analysis/report_graph.py +++ b/Analysis/report_graph.py @@ -33,14 +33,18 @@ def read_eddy_graph(edgelist, shp_tr_dir = None, read_interp = True): G.add_edge((k1, i1), (k2, i2), weight = weight) if read_interp: - # Read and set attributes of interpolated eddies: + # Try to read and set attributes of interpolated eddies: # Assuming that the directory containing the interpolated # eddies is in the same location as edgelist: extremum = path.join(path.dirname(edgelist), "SHP_triplet", "extremum") - set_attribute(G, extremum) + if os.access(extremum, os.R_OK): + set_attribute(G, extremum) + else: + print("Trying to read data on interpolated eddies but ", + f"{extremum} is not readable") if shp_tr_dir is not None: # Read and set attributes of Visible eddies: