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

Function test_nbytes_auto

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

Source from the content-addressed store, hash-verified

5758
5759
5760def test_nbytes_auto():
5761 chunks = normalize_chunks("800B", shape=(500,), dtype="float64")
5762 assert chunks == ((100, 100, 100, 100, 100),)
5763 chunks = normalize_chunks("200B", shape=(10, 10), dtype="float64")
5764 assert chunks == ((5, 5), (5, 5))
5765 chunks = normalize_chunks((5, "200B"), shape=(10, 10), dtype="float64")
5766 assert chunks == ((5, 5), (5, 5))
5767 chunks = normalize_chunks("33B", shape=(10, 10), dtype="float64")
5768 assert chunks == ((2, 2, 2, 2, 2), (2, 2, 2, 2, 2))
5769 chunks = normalize_chunks("1800B", shape=(10, 20, 30), dtype="float64")
5770 assert chunks == ((6, 4), (6, 6, 6, 2), (6, 6, 6, 6, 6))
5771
5772 with pytest.raises(ValueError):
5773 normalize_chunks("10B", shape=(10,), limit=20, dtype="float64")
5774 with pytest.raises(ValueError):
5775 normalize_chunks("100B", shape=(10, 10), limit=20, dtype="float64")
5776 with pytest.raises(ValueError):
5777 normalize_chunks(("100B", "10B"), shape=(10, 10), dtype="float64")
5778 with pytest.raises(ValueError):
5779 normalize_chunks(("10B", "10B"), shape=(10, 10), limit=20, dtype="float64")
5780
5781
5782def test_auto_chunks():

Callers

nothing calls this directly

Calls 1

normalize_chunksFunction · 0.90

Tested by

no test coverage detected