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

Function test_nbytes_auto

dask/array/tests/test_array_core.py:5699–5718  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5697
5698
5699def test_nbytes_auto():
5700 chunks = normalize_chunks("800B", shape=(500,), dtype="float64")
5701 assert chunks == ((100, 100, 100, 100, 100),)
5702 chunks = normalize_chunks("200B", shape=(10, 10), dtype="float64")
5703 assert chunks == ((5, 5), (5, 5))
5704 chunks = normalize_chunks((5, "200B"), shape=(10, 10), dtype="float64")
5705 assert chunks == ((5, 5), (5, 5))
5706 chunks = normalize_chunks("33B", shape=(10, 10), dtype="float64")
5707 assert chunks == ((2, 2, 2, 2, 2), (2, 2, 2, 2, 2))
5708 chunks = normalize_chunks("1800B", shape=(10, 20, 30), dtype="float64")
5709 assert chunks == ((6, 4), (6, 6, 6, 2), (6, 6, 6, 6, 6))
5710
5711 with pytest.raises(ValueError):
5712 normalize_chunks("10B", shape=(10,), limit=20, dtype="float64")
5713 with pytest.raises(ValueError):
5714 normalize_chunks("100B", shape=(10, 10), limit=20, dtype="float64")
5715 with pytest.raises(ValueError):
5716 normalize_chunks(("100B", "10B"), shape=(10, 10), dtype="float64")
5717 with pytest.raises(ValueError):
5718 normalize_chunks(("10B", "10B"), shape=(10, 10), limit=20, dtype="float64")
5719
5720
5721def test_auto_chunks():

Callers

nothing calls this directly

Calls 1

normalize_chunksFunction · 0.90

Tested by

no test coverage detected