(arr, idx, win_size)
return nfinite, result
Recalculate the window max based on data, index and window size.
Recalculate the window max based on data, index and window size.
Recalculate the window max based on data index and window size .
def calc_max(arr, idx, win_size):
    """Recalculate the window max based on data, index and window size."""
    start = max(0, idx - win_size + 1)
    nfinite = 0
    result = numpy.nan
    for i in range(start, idx + 1):
        value = arr[i]
        nfinite, result = put_max(value, nfinite, result)

    return nfinite, result
def calc_max ( arr , idx , win_size ) : start = max ( 0 , idx - win_size + 1 ) nfinite = 0 result = numpy . nan for i in range ( start , idx + 1 ) : value = arr [ i ] nfinite , result = put_max ( value , nfinite , result ) return nfinite , result