Skip to content

Commit

Permalink
Remove append in numba
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jun 22, 2023
1 parent d59645d commit 4390d59
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions strax/processing/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4390d59

Please sign in to comment.