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

Define intermediary variable `i_max`

parent 77ec1d5f
No related branches found
No related tags found
No related merge requests found
...@@ -150,9 +150,10 @@ def search_end(inst_eddies, max_delta, avg_fix, e_overestim): ...@@ -150,9 +150,10 @@ def search_end(inst_eddies, max_delta, avg_fix, e_overestim):
computation is not implemented that way. computation is not implemented that way.
""" """
ip = max(len(inst_eddies) - max_delta - 1, 0) i_max = len(inst_eddies) - 1
ip = max(i_max - max_delta, 0)
if not avg_fix and ip <= len(inst_eddies) - 2: if not avg_fix and ip < i_max:
d_min = ( d_min = (
util_eddies.node_to_date_eddy( util_eddies.node_to_date_eddy(
inst_eddies[-1], e_overestim, only_date=True inst_eddies[-1], e_overestim, only_date=True
...@@ -162,7 +163,7 @@ def search_end(inst_eddies, max_delta, avg_fix, e_overestim): ...@@ -162,7 +163,7 @@ def search_end(inst_eddies, max_delta, avg_fix, e_overestim):
# {date(elem) < d_min for elem in inst_eddies[:ip]} # {date(elem) < d_min for elem in inst_eddies[:ip]}
while ( while (
ip <= len(inst_eddies) - 2 ip < i_max
and util_eddies.node_to_date_eddy( and util_eddies.node_to_date_eddy(
inst_eddies[ip], e_overestim, only_date=True inst_eddies[ip], e_overestim, only_date=True
) )
......
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