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

Polish

parent 35b51fd1
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,11 @@ def new_traj(ind_traj, traj_prop, n, traj_vert_ind):
if len(sys.argv) != 2: sys.exit("Required argument: input-graph")
g = graph_tool.load_graph(sys.argv[1])
print("Loading done")
print("Input graph:")
print("Number of vertices:", g.num_vertices())
print("Number of edges:", g.num_edges())
print("Internal properties:")
g.list_properties()
if "cost_function" in g.edge_properties:
closest_succ = g.new_vertex_property('int')
......@@ -62,8 +66,8 @@ traj_vert_ind = []
# An element of traj_vert_ind is a trajectory, represented by a list
# of vertex indices.
print("Starting loop to define traj_prop...")
# Loop to define traj_prop:
for n in topology.topological_sort(g):
# First, we check whether we have a phantom pattern. Phantom
# eddies may appear in altimetric data because of
......@@ -169,7 +173,7 @@ for t in traj_vert_ind:
traj_segm.append(list_segm)
expanded_traj.append(list_eddies_traj)
print("Saving...")
# Save:
with open("traj_segm.json", "w") as outfile:
json.dump(traj_segm, outfile, separators = (',', ':'))
......
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