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

Write `e_overestim` to the graph-tool file

This will much more convenient for `cost_function.py` and
`trajectories.py`. Note we then have to create a file
`e_overestim.txt` for `Trajectories/Tests/edgelist_Isic_[12].csv`.
parent 265ed9ec
No related branches found
No related tags found
No related merge requests found
1
...@@ -15,6 +15,7 @@ import graph_tool ...@@ -15,6 +15,7 @@ import graph_tool
import time import time
import sys import sys
import pathlib import pathlib
from os import path
if len(sys.argv) != 3: if len(sys.argv) != 3:
sys.exit("Required arguments: input-edgelist-file output-graph-tool-file") sys.exit("Required arguments: input-edgelist-file output-graph-tool-file")
...@@ -40,6 +41,17 @@ t0 = t1 ...@@ -40,6 +41,17 @@ t0 = t1
# Processing: # Processing:
# e_overestim is not used in this script but it useful to save it to
# the output graph of this script for further processing of the output
# graph by other scripts:
g.graph_properties["e_overestim"] = g.new_graph_property("int")
dir_edgelist = path.dirname(sys.argv[1])
e_overestim_file = path.join(dir_edgelist, "e_overestim.txt")
with open(e_overestim_file) as f:
g.graph_properties["e_overestim"] = int(f.read())
g.vp['inst_eddies'] = g.new_vp('vector<int>') g.vp['inst_eddies'] = g.new_vp('vector<int>')
for v in g.vertices(): g.vp.inst_eddies[v] = [int(g.vp.name[v])] for v in g.vertices(): g.vp.inst_eddies[v] = [int(g.vp.name[v])]
# "inst_eddies" is the list of instantaneous eddies represented by a # "inst_eddies" is the list of instantaneous eddies represented by a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment