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

Function _check_chunks

dask/array/utils.py:244–257  ·  view source on GitHub ↗
(x, check_ndim=True, scheduler=None)

Source from the content-addressed store, hash-verified

242
243
244def _check_chunks(x, check_ndim=True, scheduler=None):
245 x = x.persist(scheduler=scheduler)
246 for idx in itertools.product(*(range(len(c)) for c in x.chunks)):
247 chunk = x.dask[(x.name,) + idx]
248 if hasattr(chunk, "result"): # it's a future
249 chunk = chunk.result()
250 if not hasattr(chunk, "dtype"):
251 chunk = np.array(chunk, dtype="O")
252 expected_shape = tuple(c[i] for c, i in zip(x.chunks, idx))
253 assert_eq_shape(
254 expected_shape, chunk.shape, check_ndim=check_ndim, check_nan=False
255 )
256 assert chunk.dtype == x.dtype
257 return x
258
259
260def _get_dt_meta_computed(

Callers 1

_get_dt_meta_computedFunction · 0.85

Calls 3

assert_eq_shapeFunction · 0.85
productMethod · 0.80
persistMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…