@@ -34,32 +34,6 @@ def bisect_left(a: list[Any], x: Any, lo: int = 0, hi: int = -1) -> int:
3434 return lo
3535
3636
37- # *** Notations ***
38- # N: size of the values[] array.
39- # NN: last accessed element (1-based) in the values[] array, that is max_<i>(end[<i>]).
40- # In most cases NN==N (unless you are using a custom window indexer).
41- # M: number of min/max "jobs", that is, size of start[] and end[] arrays.
42- # In pandas' common usage, M==N==NN, but it does not have to!
43- # k: maximum window size, that is max<i>(end[<i>] - start[<i>])
44- #
45- # *** Complexity ***
46- # - O(max(NN,M)) for constant window sizes.
47- # - O(max(NN,M)*log(k)) for arbitrary window sizes.
48- #
49- # *** Assumptions ***
50- # The min/max "jobs" have to be ordered in the lexiographical (end[i], start[i]) order.
51- # In the regular pandas' case with constant window size these array ARE properly
52- # sorted by construction.
53- # In other words, for each i = 0..N-2, this condition must hold:
54- # - (end[i+1] > end[i]) OR
55- # - (end[i+1] == end[i] AND start[i+1] >= start[i])
56- #
57- # To debug this with your favorite Python debugger:
58- # - Comment out the "numba.jit" line right below this comment above the function def.
59- # - Find and comment out a similar line in column_looper() defined in
60- # generate_apply_looper() in executor.py.
61- # - Place a breakpoint in this function. Your Python debugger will stop there!
62- # - (Debugging was tested with VSCode on WSL.)
6337@numba .jit (nopython = True , nogil = True , parallel = False )
6438def sliding_min_max (
6539 values : np .ndarray ,
0 commit comments