(x, check_ndim=True, scheduler=None)
| 242 | |
| 243 | |
| 244 | def _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 | |
| 260 | def _get_dt_meta_computed( |
no test coverage detected
searching dependent graphs…