@@ -848,8 +848,7 @@ def test_nchunks_initialized(self):
848
848
849
849
def test_unstructured_array (self ):
850
850
851
- subshape = (2 , 2 )
852
- dt = np .dtype ("%sf4" % (subshape ,))
851
+ dt = "(2, 2)f4"
853
852
# setup some data
854
853
d = np .array ([((0 , 1 ),
855
854
(1 , 2 )),
@@ -861,7 +860,7 @@ def test_unstructured_array(self):
861
860
862
861
for a in (d , d [:0 ]):
863
862
for fill_value in None , 0 :
864
- z = self .create_array (shape = a .shape [:- len ( subshape ) ], chunks = 2 , dtype = dt , fill_value = fill_value )
863
+ z = self .create_array (shape = a .shape [:- 2 ], chunks = 2 , dtype = dt , fill_value = fill_value )
865
864
assert len (a ) == len (z )
866
865
if fill_value is not None :
867
866
assert fill_value == z .fill_value
@@ -926,7 +925,8 @@ def test_structured_array_subshapes(self):
926
925
assert_array_equal (a ['bar' ], z ['bar' ])
927
926
assert_array_equal (a ['baz' ], z ['baz' ])
928
927
else :
929
- # BUG(onalant): numpy cannot compare empty arrays of structured dtypes with shapes
928
+ # BUG(onalant): numpy cannot compare empty arrays of structured dtypes with
929
+ # subshapes
930
930
assert a .tobytes () == z [...].tobytes ()
931
931
932
932
def test_structured_array_nested (self ):
@@ -935,7 +935,8 @@ def test_structured_array_nested(self):
935
935
d = np .array ([(0 , (0 , ((0 , 1 ), (1 , 2 ), (2 , 3 )), 0 ), b'aaa' ),
936
936
(1 , (1 , ((1 , 2 ), (2 , 3 ), (3 , 4 )), 1 ), b'bbb' ),
937
937
(2 , (2 , ((2 , 3 ), (3 , 4 ), (4 , 5 )), 2 ), b'ccc' )],
938
- dtype = [('foo' , 'i8' ), ('bar' , [('foo' , 'i4' ), ('bar' , '(3, 2)f4' ), ('baz' , 'u1' )]), ('baz' , 'S3' )])
938
+ dtype = [('foo' , 'i8' ), ('bar' , [('foo' , 'i4' ), ('bar' , '(3, 2)f4' ),
939
+ ('baz' , 'u1' )]), ('baz' , 'S3' )])
939
940
for a in (d , d [:0 ]):
940
941
for fill_value in None , b'' , (0 , (0 , ((0 , 0 ), (1 , 1 ), (2 , 2 )), 0 ), b'zzz' ):
941
942
z = self .create_array (shape = a .shape , chunks = 2 , dtype = a .dtype , fill_value = fill_value )
@@ -958,7 +959,8 @@ def test_structured_array_nested(self):
958
959
assert_array_equal (a ['bar' ], z ['bar' ])
959
960
assert_array_equal (a ['baz' ], z ['baz' ])
960
961
else :
961
- # BUG(onalant): numpy cannot compare empty arrays of structured dtypes with shapes
962
+ # BUG(onalant): numpy cannot compare empty arrays of structured dtypes with
963
+ # subshapes
962
964
assert a .tobytes () == z [...].tobytes ()
963
965
964
966
def test_dtypes (self ):
0 commit comments