Skip to content
Snippets Groups Projects
Commit 5f2375e1 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent 74a28cde
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3 #!/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 from os import path
import os import os
import json import json
...@@ -15,6 +21,7 @@ def read_eddy_graph(edgelist, shpc_dir=None, orientation="Cyclones"): ...@@ -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) G = nx.read_edgelist(edgelist, create_using=nx.DiGraph, nodetype=int)
dir_edgelist = path.dirname(edgelist) dir_edgelist = path.dirname(edgelist)
e_overestim_file = path.join(dir_edgelist, "e_overestim.txt") e_overestim_file = path.join(dir_edgelist, "e_overestim.txt")
with open(e_overestim_file) as f: with open(e_overestim_file) as f:
G.graph["e_overestim"] = int(f.read()) G.graph["e_overestim"] = int(f.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment