@@ -35,6 +35,10 @@ def test_guess_chunks(shape: tuple[int, ...], itemsize: int) -> None:
3535 ((30 , None , None ), (100 , 20 , 10 ), 1 , (30 , 20 , 10 )),
3636 ((30 , 20 , None ), (100 , 20 , 10 ), 1 , (30 , 20 , 10 )),
3737 ((30 , 20 , 10 ), (100 , 20 , 10 ), 1 , (30 , 20 , 10 )),
38+ # dask-style chunks (uniform with optional smaller final chunk)
39+ (((100 , 100 , 100 ), (50 , 50 )), (300 , 100 ), 1 , (100 , 50 )),
40+ (((100 , 100 , 50 ),), (250 ,), 1 , (100 ,)),
41+ (((100 ,),), (100 ,), 1 , (100 ,)),
3842 # auto chunking
3943 (None , (100 ,), 1 , (100 ,)),
4044 (- 1 , (100 ,), 1 , (100 ,)),
@@ -52,3 +56,8 @@ def test_normalize_chunks_errors() -> None:
5256 normalize_chunks ("foo" , (100 ,), 1 )
5357 with pytest .raises (ValueError ):
5458 normalize_chunks ((100 , 10 ), (100 ,), 1 )
59+ # dask-style irregular chunks should raise
60+ with pytest .raises (ValueError , match = "Irregular chunk sizes" ):
61+ normalize_chunks (((10 , 20 , 30 ),), (60 ,), 1 )
62+ with pytest .raises (ValueError , match = "Irregular chunk sizes" ):
63+ normalize_chunks (((100 , 100 ), (10 , 20 )), (200 , 30 ), 1 )
0 commit comments