From 5f2375e17a3ded9af3fd89afbb751428738fbc6f Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Mon, 12 Feb 2024 19:53:44 +0100 Subject: [PATCH] Polish --- Overlap/report_graph.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Overlap/report_graph.py b/Overlap/report_graph.py index 0797c026..c414908f 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()) -- GitLab