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(
431431 )
432432 ):
433433 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 } )."
435436 )
436437
437438 async def _decode_single (
Original file line number Diff line number Diff line change 11import pickle
2+ import re
23from typing import Any
34
45import numpy as np
@@ -486,3 +487,20 @@ def test_invalid_metadata(store: Store) -> None:
486487 dtype = np .dtype ("uint8" ),
487488 fill_value = 0 ,
488489 )
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