()
| 5535 | |
| 5536 | |
| 5537 | def test_nbytes_auto(): |
| 5538 | chunks = normalize_chunks("800B", shape=(500,), dtype="float64") |
| 5539 | assert chunks == ((100, 100, 100, 100, 100),) |
| 5540 | chunks = normalize_chunks("200B", shape=(10, 10), dtype="float64") |
| 5541 | assert chunks == ((5, 5), (5, 5)) |
| 5542 | chunks = normalize_chunks((5, "200B"), shape=(10, 10), dtype="float64") |
| 5543 | assert chunks == ((5, 5), (5, 5)) |
| 5544 | chunks = normalize_chunks("33B", shape=(10, 10), dtype="float64") |
| 5545 | assert chunks == ((2, 2, 2, 2, 2), (2, 2, 2, 2, 2)) |
| 5546 | chunks = normalize_chunks("1800B", shape=(10, 20, 30), dtype="float64") |
| 5547 | assert chunks == ((6, 4), (6, 6, 6, 2), (6, 6, 6, 6, 6)) |
| 5548 | |
| 5549 | with pytest.raises(ValueError): |
| 5550 | normalize_chunks("10B", shape=(10,), limit=20, dtype="float64") |
| 5551 | with pytest.raises(ValueError): |
| 5552 | normalize_chunks("100B", shape=(10, 10), limit=20, dtype="float64") |
| 5553 | with pytest.raises(ValueError): |
| 5554 | normalize_chunks(("100B", "10B"), shape=(10, 10), dtype="float64") |
| 5555 | with pytest.raises(ValueError): |
| 5556 | normalize_chunks(("10B", "10B"), shape=(10, 10), limit=20, dtype="float64") |
| 5557 | |
| 5558 | |
| 5559 | def test_auto_chunks(): |
nothing calls this directly
no test coverage detected