Return a similar oindex with after replacing slices by arrays and negative indices by their corresponding positive indices. Also check if array indices are within bounds.
(indexer: OuterIndexer, shape)
| 1479 | |
| 1480 | |
| 1481 | def _arrayize_outer_indexer(indexer: OuterIndexer, shape) -> OuterIndexer: |
| 1482 | """Return a similar oindex with after replacing slices by arrays and |
| 1483 | negative indices by their corresponding positive indices. |
| 1484 | |
| 1485 | Also check if array indices are within bounds. |
| 1486 | |
| 1487 | """ |
| 1488 | new_key = [] |
| 1489 | |
| 1490 | for axis, value in enumerate(indexer.tuple): |
| 1491 | size = shape[axis] |
| 1492 | if isinstance(value, slice): |
| 1493 | value = _expand_slice(value, size) |
| 1494 | else: |
| 1495 | value = _posify_indices(value, size) |
| 1496 | _check_bounds(value, size) |
| 1497 | new_key.append(value) |
| 1498 | |
| 1499 | return OuterIndexer(tuple(new_key)) |
| 1500 | |
| 1501 | |
| 1502 | def _arrayize_vectorized_indexer( |
no test coverage detected
searching dependent graphs…