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

Polish

parent b3f809f4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@
"""
import networkx as nx
import csv
import shapefile
from os import path
from networkx import nx_agraph
......
......@@ -4,10 +4,9 @@
# non-local cost function calculation where each edge will have a cost
# function assigned to it.
# Inputs (to be changed within the script):
# Orientation
# node_id_param_file location and name
# gt graph name and location
# shapefiles names and location
# node_id_param_file
# gt graph
# shapefiles
# Output: a gt graph with cost functions and an xml graph with cost functions
import graph_tool
......@@ -71,10 +70,10 @@ def get_SHPC(array_d_ini, date_index):
assert i_SHPC >= 1
return i_SHPC - 1
###############################
# grab e_overestim
###############################
if len(sys.argv) == 1:
sys.exit("Required arguments: SHPC-directory [SHPC-directory] ...")
# Grab e_overestim:
with open("node_id_param.json") as f: node_id_param = json.load(f)
# assign attributes to the whole graphs
e_overestim = node_id_param["e_overestim"]
......@@ -119,9 +118,6 @@ g.ep['nl_cost_function'] = g.new_ep('float')
# Set up the list of SHPC:
if len(sys.argv) == 1:
sys.exit("Required arguments: SHPC-directory [SHPC-directory] ...")
handlers = [util_eddies.open_shpc(shp_dir) for shp_dir in sys.argv[1:]]
array_d_init = [handler["d_init"] for handler in handlers]
......
......@@ -32,6 +32,8 @@ g = graph_tool.load_graph_from_csv(sys.argv[1],
print("Input graph:")
print("Number of vertices:", g.num_vertices())
print("Number of edges:", g.num_edges())
print("Internal properties:")
g.list_properties()
t1 = time.perf_counter()
print(f'Loading done in {t1 - t0:.0f} s')
t0 = t1
......
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