From 6aef09eaa2a5b9f524de75e9a383a3d08350c5af Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Wed, 18 May 2022 17:43:33 +0200 Subject: [PATCH] Also output the list of unexpanded segments --- gt_matlab_trajs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gt_matlab_trajs.py b/gt_matlab_trajs.py index ce11b524..24dbc971 100755 --- a/gt_matlab_trajs.py +++ b/gt_matlab_trajs.py @@ -66,6 +66,9 @@ for node in g.vertices(): else: trajectories[g.vp.traj[node]].append(g.vp.name[node]) +with open("trajectories.json", "w") as outfile: + json.dump(trajectories, outfile, indent = 4) + # Setup a new trajectory that holds the expanded segments: expanded_trajectories = {} @@ -88,7 +91,7 @@ for trajectory in trajectories.values(): else: expanded_trajectories[key].append(s) -with open("trajectories.json", "w") as outfile: +with open("expanded_trajectories.json", "w") as outfile: json.dump(expanded_trajectories, outfile, indent = 4) print(f'Done saving json: {len(trajectories)} trajectories.') -- GitLab