Convert negative indices by their equivalent positive indices. Note: the resulting indices may still be out of bounds (< 0 or >= size).
(indices: Any, size: int)
| 1464 | |
| 1465 | |
| 1466 | def _posify_indices(indices: Any, size: int) -> np.ndarray: |
| 1467 | """Convert negative indices by their equivalent positive indices. |
| 1468 | |
| 1469 | Note: the resulting indices may still be out of bounds (< 0 or >= size). |
| 1470 | |
| 1471 | """ |
| 1472 | return np.where(indices < 0, size + indices, indices) |
| 1473 | |
| 1474 | |
| 1475 | def _check_bounds(indices: Any, size: int): |
no test coverage detected
searching dependent graphs…