diff --git a/Overlap/report_graph.py b/Overlap/report_graph.py index 0797c026cf2bc2e282b3efcddfc2145c3676be92..c414908fd8f3c6d81260db68d849adeab95a1503 100755 --- a/Overlap/report_graph.py +++ b/Overlap/report_graph.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +"""Note that this script loads the whole graph into memory, with +networkx, even with option --node. For the global graph on 28 years, +this requires about 13 GiB of main memory. + +""" + from os import path import os import json @@ -15,6 +21,7 @@ def read_eddy_graph(edgelist, shpc_dir=None, orientation="Cyclones"): G = nx.read_edgelist(edgelist, create_using=nx.DiGraph, nodetype=int) dir_edgelist = path.dirname(edgelist) e_overestim_file = path.join(dir_edgelist, "e_overestim.txt") + with open(e_overestim_file) as f: G.graph["e_overestim"] = int(f.read())