()
| 382 | |
| 383 | |
| 384 | def test_Array(): |
| 385 | arr = object() # arraylike is unimportant since we never compute |
| 386 | shape = (1000, 1000) |
| 387 | chunks = (100, 100) |
| 388 | name = "x" |
| 389 | dsk = graph_from_arraylike(arr, chunks, shape, name) |
| 390 | a = Array(dsk, name, chunks, shape=shape, dtype="f8") |
| 391 | |
| 392 | assert a.numblocks == (10, 10) |
| 393 | |
| 394 | assert a.__dask_keys__() == [[("x", i, j) for j in range(10)] for i in range(10)] |
| 395 | |
| 396 | assert a.chunks == ((100,) * 10, (100,) * 10) |
| 397 | |
| 398 | assert a.shape == shape |
| 399 | |
| 400 | assert len(a) == shape[0] |
| 401 | |
| 402 | with pytest.raises(ValueError): |
| 403 | Array(dsk, name, chunks, shape=shape) |
| 404 | with pytest.raises(TypeError): |
| 405 | Array(dsk, name, chunks, shape=shape, dtype="f8", meta=np.empty(0, 0)) |
| 406 | |
| 407 | |
| 408 | def test_uneven_chunks(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…