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

Manage missing trajectories

This can happen if the input graph file contains only an extracted
component.
parent 1ba8df59
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,13 @@ if args.t:
color = next(colors)
for segment in segment_list:
n = g_out.get_node(segment)
n.attr["label"] = f"{segment} in {i}"
n.attr["color"] = color
try:
n = g_out.get_node(segment)
except KeyError:
break
else:
n.attr["label"] = f"{segment} in {i}"
n.attr["color"] = color
g_out.write(args.output_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment