()
| 5721 | |
| 5722 | |
| 5723 | def test_nbytes_auto(): |
| 5724 | chunks = normalize_chunks("800B", shape=(500,), dtype="float64") |
| 5725 | assert chunks == ((100, 100, 100, 100, 100),) |
| 5726 | chunks = normalize_chunks("200B", shape=(10, 10), dtype="float64") |
| 5727 | assert chunks == ((5, 5), (5, 5)) |
| 5728 | chunks = normalize_chunks((5, "200B"), shape=(10, 10), dtype="float64") |
| 5729 | assert chunks == ((5, 5), (5, 5)) |
| 5730 | chunks = normalize_chunks("33B", shape=(10, 10), dtype="float64") |
| 5731 | assert chunks == ((2, 2, 2, 2, 2), (2, 2, 2, 2, 2)) |
| 5732 | chunks = normalize_chunks("1800B", shape=(10, 20, 30), dtype="float64") |
| 5733 | assert chunks == ((6, 4), (6, 6, 6, 2), (6, 6, 6, 6, 6)) |
| 5734 | |
| 5735 | with pytest.raises(ValueError): |
| 5736 | normalize_chunks("10B", shape=(10,), limit=20, dtype="float64") |
| 5737 | with pytest.raises(ValueError): |
| 5738 | normalize_chunks("100B", shape=(10, 10), limit=20, dtype="float64") |
| 5739 | with pytest.raises(ValueError): |
| 5740 | normalize_chunks(("100B", "10B"), shape=(10, 10), dtype="float64") |
| 5741 | with pytest.raises(ValueError): |
| 5742 | normalize_chunks(("10B", "10B"), shape=(10, 10), limit=20, dtype="float64") |
| 5743 | |
| 5744 | |
| 5745 | def test_auto_chunks(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…