MCPcopy Index your code
hub / github.com/pydata/xarray / _arrayize_outer_indexer

Function _arrayize_outer_indexer

xarray/core/indexing.py:1481–1499  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1479
1480
1481def _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
1502def _arrayize_vectorized_indexer(

Callers 1

_oindex_getMethod · 0.85

Calls 4

_expand_sliceFunction · 0.85
_posify_indicesFunction · 0.85
_check_boundsFunction · 0.85
OuterIndexerClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…