1313# mix of dtypes: integer, float
1414# mix of shapes: 1D, 2D, 3D
1515# mix of orders: C, F
16+ # mix of encoding types: All available types for each arrays
1617arrays = [
17- np .random .randint (0 , 1 , size = 110 , dtype = '?' ).reshape (10 , 11 ),
18- np .arange (1000 , dtype = '<i4' ),
19- np .linspace (1000 , 1001 , 1000 , dtype = '<f4' ).reshape (100 , 10 ),
20- np .random .normal (loc = 1000 , scale = 1 , size = (10 , 10 , 10 )).astype ('<f8' ),
21- np .random .randint (0 , 200 , size = 1000 , dtype = 'u2' ).astype ('<u2' ).reshape (100 , 10 , order = 'F' ),
18+ ( np .random .randint (0 , 1 , size = 110 , dtype = '?' ).reshape (10 , 11 ), ( '?' , '<u1' , '<i1' ) ),
19+ ( np .arange (1000 , dtype = '<i4' ), ( '<i4' , '<i2' , '<u4' , 'u2' ) ),
20+ ( np .linspace (1000 , 1001 , 1000 , dtype = '<f4' ).reshape (100 , 10 ), ( '<f4' ,) ),
21+ ( np .random .normal (loc = 1000 , scale = 1 , size = (10 , 10 , 10 )).astype ('<f8' ), ( '<f8' ,) ),
22+ ( np .random .randint (0 , 200 , size = 1000 , dtype = 'u2' ).astype ('<u2' ).reshape (100 , 10 , order = 'F' ), ( '<i2' ,) ),
2223]
2324
24-
2525def test_encode_decode ():
26- for arr in arrays :
27- codec = Delta (dtype = arr .dtype )
28- check_encode_decode (arr , codec )
26+ for arr , encoding_types in arrays :
27+ for astype in encoding_types :
28+ codec = Delta (dtype = arr .dtype , astype = astype )
29+ check_encode_decode (arr , codec )
2930
3031
3132def test_encode ():
@@ -49,7 +50,7 @@ def test_repr():
4950
5051
5152def test_backwards_compatibility ():
52- for arr in arrays :
53+ for arr , _ in arrays :
5354 codec = Delta (dtype = arr .dtype )
5455 check_backwards_compatibility (Delta .codec_id , [arr ], [codec ], prefix = str (arr .dtype ))
5556
0 commit comments