From 4390d592b355d01990aca18f29781676d876f531 Mon Sep 17 00:00:00 2001 From: dachengxu Date: Thu, 22 Jun 2023 19:34:42 +0800 Subject: [PATCH] Remove append in numba --- strax/processing/general.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/strax/processing/general.py b/strax/processing/general.py index 7d89cb8e0..cb987033a 100644 --- a/strax/processing/general.py +++ b/strax/processing/general.py @@ -413,8 +413,6 @@ def _touching_windows(thing_start, thing_end, container_n = len(container_start) thing_end_argsort = np.argsort(thing_end, kind=endtime_sort_kind) thing_end_sort = thing_end[thing_end_argsort] - # append extra element to the end of the array to avoid index out of bound - thing_end_argsort = np.append(thing_end_argsort, thing_n) container_end_argsort = np.argsort(container_end, kind=endtime_sort_kind) # we search twice, first for the beginning of the interval, then for the end @@ -428,7 +426,7 @@ def _touching_windows(thing_start, thing_end, # left_i ends before the window starts (so it's still outside) left_i += 1 # save the most left index of things touching the container - result[i, 0] = min(thing_end_argsort[left_i:]) + result[i, 0] = left_i if left_i == thing_n else min(thing_end_argsort[left_i:]) # then search for the end of the interval # containers' endtime is not sorted but things' endtime is