MCPcopy Create free account
hub / github.com/dask/dask / _validate_indexer

Function _validate_indexer

dask/array/_shuffle.py:166–178  ·  view source on GitHub ↗
(chunks, indexer, axis)

Source from the content-addressed store, hash-verified

164
165
166def _validate_indexer(chunks, indexer, axis):
167 if not isinstance(indexer, list) or not all(isinstance(i, list) for i in indexer):
168 raise ValueError("indexer must be a list of lists of positional indices")
169
170 if not axis <= len(chunks):
171 raise ValueError(
172 f"Axis {axis} is out of bounds for array with {len(chunks)} axes"
173 )
174
175 if max(map(max, indexer)) >= sum(chunks[axis]):
176 raise IndexError(
177 f"Indexer contains out of bounds index. Dimension only has {sum(chunks[axis])} elements."
178 )
179
180
181def _shuffle(chunks, indexer, axis, in_name, out_name, token):

Callers 2

shuffleFunction · 0.70
_shuffleFunction · 0.70

Calls 3

allFunction · 0.85
maxFunction · 0.85
sumFunction · 0.70

Tested by

no test coverage detected