File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -431,7 +431,8 @@ def validate(
431
431
)
432
432
):
433
433
raise ValueError (
434
- "The array's `chunk_shape` needs to be divisible by the shard's inner `chunk_shape`."
434
+ f"The array's `chunk_shape` (got { chunk_grid .chunk_shape } ) "
435
+ f"needs to be divisible by the shard's inner `chunk_shape` (got { self .chunk_shape } )."
435
436
)
436
437
437
438
async def _decode_single (
Original file line number Diff line number Diff line change 1
1
import pickle
2
+ import re
2
3
from typing import Any
3
4
4
5
import numpy as np
@@ -486,3 +487,20 @@ def test_invalid_metadata(store: Store) -> None:
486
487
dtype = np .dtype ("uint8" ),
487
488
fill_value = 0 ,
488
489
)
490
+
491
+
492
+ def test_invalid_shard_shape () -> None :
493
+ with pytest .raises (
494
+ ValueError ,
495
+ match = re .escape (
496
+ "The array's `chunk_shape` (got (16, 16)) needs to be divisible by the shard's inner `chunk_shape` (got (9,))."
497
+ ),
498
+ ):
499
+ zarr .create_array (
500
+ {},
501
+ shape = (16 , 16 ),
502
+ shards = (16 , 16 ),
503
+ chunks = (9 ,),
504
+ dtype = np .dtype ("uint8" ),
505
+ fill_value = 0 ,
506
+ )
You can’t perform that action at this time.
0 commit comments