()
| 5758 | |
| 5759 | |
| 5760 | def 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 | |
| 5782 | def test_auto_chunks(): |
nothing calls this directly
no test coverage detected