`np.clip` is not supported by numba, but the following works
(arr, vmin, vmax)
| 1306 | index = np.arange(n_background) |
| 1307 | |
| 1308 | def _clip(arr, vmin, vmax): |
| 1309 | """`np.clip` is not supported by numba, but the following works""" |
| 1310 | arr[arr < vmin] = vmin |
| 1311 | arr[arr > vmax] = vmax |
| 1312 | return arr |
| 1313 | |
| 1314 | v_xmin, v_xmax = max(xmin, 0), min(xmax, n_background - 1) |
| 1315 |