From 9dc646dcbf81d58e1441a6d5266326d23107309f Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Fri, 10 Mar 2023 16:03:43 +0100 Subject: [PATCH] Polish --- Trajectories/segments.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Trajectories/segments.py b/Trajectories/segments.py index c8b40850..f896b7aa 100755 --- a/Trajectories/segments.py +++ b/Trajectories/segments.py @@ -4,7 +4,8 @@ the graph of segments. A vertex of the new graph is a segment. Input file should be an edgelist in CSV format. The new graph is output in the binary format of Graph-tool (file with suffix ".gt") or in GraphML -format (suffix ".graphml".) +format (suffix ".graphml".) The algorithm in this script does not rely +on any ordering of the input edgelist. """ @@ -49,12 +50,12 @@ for v in g.vertices(): # v continues a segment, circumvent v: g.remove_edge(g.edge(v2, v)) - g.vp.inst_eddies[v2].append(int(g.vp.name[v])) for v3 in v.out_neighbors(): g.remove_edge(g.edge(v, v3)) g.add_edge(v2, v3) + g.vp.inst_eddies[v2].append(int(g.vp.name[v])) verts_to_del.append(v) t1 = time.perf_counter() -- GitLab