Skip to content

Commit 1c8e45b

Browse files
Tarik Onalanalimanfoo
authored andcommitted
Fix flake8 complaints
1 parent aad7e94 commit 1c8e45b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

zarr/tests/test_core.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,7 @@ def test_nchunks_initialized(self):
848848

849849
def test_unstructured_array(self):
850850

851-
subshape = (2, 2)
852-
dt = np.dtype("%sf4" % (subshape,))
851+
dt = "(2, 2)f4"
853852
# setup some data
854853
d = np.array([((0, 1),
855854
(1, 2)),
@@ -861,7 +860,7 @@ def test_unstructured_array(self):
861860

862861
for a in (d, d[:0]):
863862
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)
865864
assert len(a) == len(z)
866865
if fill_value is not None:
867866
assert fill_value == z.fill_value
@@ -926,7 +925,8 @@ def test_structured_array_subshapes(self):
926925
assert_array_equal(a['bar'], z['bar'])
927926
assert_array_equal(a['baz'], z['baz'])
928927
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
930930
assert a.tobytes() == z[...].tobytes()
931931

932932
def test_structured_array_nested(self):
@@ -935,7 +935,8 @@ def test_structured_array_nested(self):
935935
d = np.array([(0, (0, ((0, 1), (1, 2), (2, 3)), 0), b'aaa'),
936936
(1, (1, ((1, 2), (2, 3), (3, 4)), 1), b'bbb'),
937937
(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')])
939940
for a in (d, d[:0]):
940941
for fill_value in None, b'', (0, (0, ((0, 0), (1, 1), (2, 2)), 0), b'zzz'):
941942
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):
958959
assert_array_equal(a['bar'], z['bar'])
959960
assert_array_equal(a['baz'], z['baz'])
960961
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
962964
assert a.tobytes() == z[...].tobytes()
963965

964966
def test_dtypes(self):

0 commit comments

Comments
 (0)