From 403cfb397c9ffd198039fd39f30736bceff97c6f Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Tue, 28 May 2024 21:33:35 +0200 Subject: [PATCH] Remove intermediary variable `len_seg` --- Trajectories/cost_function.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Trajectories/cost_function.py b/Trajectories/cost_function.py index aa293b84..b9bfa1ab 100755 --- a/Trajectories/cost_function.py +++ b/Trajectories/cost_function.py @@ -200,9 +200,7 @@ for n in g.vertices(): if n.out_degree() != 0: # Define properties for end of the segment: - len_seg = len(g.vp.inst_eddies[n]) - - if ip_beg < len_seg: + if ip_beg < len(g.vp.inst_eddies[n]): # We have to read more from the shapefiles and redefine # properties. ip_end = search_end(g.vp.inst_eddies[n], max_delta) @@ -217,7 +215,7 @@ for n in g.vertices(): args.orientation, ) else: - # assertion: ip_end < ip_beg < len_seg + # assertion: ip_end < ip_beg < len(g.vp.inst_eddies[n]) # We can use part of the properties from the beginning # of the segment. -- GitLab