44import blosc2
55
66
7- @pytest .mark .parametrize (
8- ("shape" , "chunks" , "blocks" ),
9- {
7+ @pytest .fixture (
8+ params = [
109 ((3 , 3 ), (2 , 2 ), (1 , 1 )),
1110 ((12 , 11 ), (7 , 5 ), (6 , 2 )),
1211 ((1 , 5 ), (1 , 4 ), (1 , 3 )),
13- ((201 , 1903 ), None , None ),
12+ ((51 , 603 ), ( 22 , 99 ), ( 13 , 29 ) ),
1413 ((10 ,), (5 ,), None ),
15- },
14+ ]
1615)
16+ def shape_chunks_blocks (request ):
17+ return request .param
18+
19+
1720@pytest .mark .parametrize (
1821 "dtype" ,
1922 {np .int32 , np .int64 , np .float32 , np .float64 },
2023)
21- def test_transpose (shape , chunks , blocks , dtype ):
24+ def test_transpose (shape_chunks_blocks , dtype ):
25+ shape , chunks , blocks = shape_chunks_blocks
2226 a = blosc2 .linspace (0 , 1 , shape = shape , chunks = chunks , blocks = blocks , dtype = dtype )
2327 at = blosc2 .transpose (a )
2428
@@ -28,21 +32,12 @@ def test_transpose(shape, chunks, blocks, dtype):
2832 np .testing .assert_allclose (at , nat )
2933
3034
31- @pytest .mark .parametrize (
32- ("shape" , "chunks" , "blocks" ),
33- {
34- ((3 , 3 ), (2 , 2 ), (1 , 1 )),
35- ((12 , 11 ), (7 , 5 ), (6 , 2 )),
36- ((1 , 5 ), (1 , 4 ), (1 , 3 )),
37- ((201 , 1903 ), None , None ),
38- ((10 ,), (5 ,), None ),
39- },
40- )
4135@pytest .mark .parametrize (
4236 "dtype" ,
4337 {np .complex64 , np .complex128 },
4438)
45- def test_complex (shape , chunks , blocks , dtype ):
39+ def test_complex (shape_chunks_blocks , dtype ):
40+ shape , chunks , blocks = shape_chunks_blocks
4641 real_part = blosc2 .linspace (0 , 1 , shape = shape , chunks = chunks , blocks = blocks , dtype = dtype )
4742 imag_part = blosc2 .linspace (0 , 1 , shape = shape , chunks = chunks , blocks = blocks , dtype = dtype )
4843 complex_matrix = real_part + 1j * imag_part
0 commit comments