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

Write `e_overestim` to the graph-tool file

So we can use the output file of `extract_component.py` as input of
`draw_segments.py`, for example.
parent e66bc9c4
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ each vertex of the graph. ...@@ -11,6 +11,7 @@ each vertex of the graph.
import csv import csv
import pathlib import pathlib
import sys import sys
from os import path
import graph_tool import graph_tool
from graph_tool import topology from graph_tool import topology
...@@ -32,6 +33,12 @@ if input_suffix == ".csv": ...@@ -32,6 +33,12 @@ if input_suffix == ".csv":
hash_type="int", hash_type="int",
csv_options = {'delimiter': ' ', csv_options = {'delimiter': ' ',
'skipinitialspace': True}) 'skipinitialspace': True})
dir_edgelist = path.dirname(sys.argv[1])
e_overestim_file = path.join(dir_edgelist, "e_overestim.txt")
g.graph_properties["e_overestim"] = g.new_graph_property("int")
with open(e_overestim_file) as f_obj:
g.graph_properties["e_overestim"] = int(f_obj.read())
else: else:
# assert input_suffix in {".gt", ".graphml"} # assert input_suffix in {".gt", ".graphml"}
g = graph_tool.load_graph(sys.argv[1]) g = graph_tool.load_graph(sys.argv[1])
......
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