@@ -91,31 +91,31 @@ def test(self):
91
91
92
92
@check_opt_slicing
93
93
def test_whole_array (self ):
94
- """ Reading a slice covering the whole array """
94
+ """Reading a slice covering the whole array"""
95
95
self .assertArrayEqual (self .dset [:], self .arr )
96
96
97
97
@check_opt_slicing
98
98
def test_cross_chunk_1dim (self ):
99
- """ Reading a slice crossing chunk boundaries (1-dim) """
99
+ """Reading a slice crossing chunk boundaries (1-dim)"""
100
100
slc = slice (self .dset .chunks [0 ] - 5 , self .dset .chunks [0 ] + 5 )
101
101
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
102
102
103
103
@check_opt_slicing
104
104
def test_cross_chunk_ndim (self ):
105
- """ Reading a slice crossing chunk boundaries (n-dim) """
105
+ """Reading a slice crossing chunk boundaries (n-dim)"""
106
106
slc = (slice (self .dset .chunks [0 ] - 5 , self .dset .chunks [0 ] + 5 ),
107
107
slice (self .dset .chunks [1 ] - 5 , self .dset .chunks [1 ] + 5 ))
108
108
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
109
109
110
110
@check_opt_slicing
111
111
def test_last_chunk_1dim (self ):
112
- """ Reading a slice going past the last chunk (1-dim) """
112
+ """Reading a slice going past the last chunk (1-dim)"""
113
113
slc = slice (self .dset .shape [0 ] - 5 , self .dset .shape [0 ] + 5 )
114
114
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
115
115
116
116
@check_opt_slicing
117
117
def test_last_chunk_ndim (self ):
118
- """ Reading a slice going past the last chunk (n-dim) """
118
+ """Reading a slice going past the last chunk (n-dim)"""
119
119
slc = (slice (self .dset .shape [0 ] - 5 , self .dset .shape [0 ] + 5 ),
120
120
slice (self .dset .shape [1 ] - 5 , self .dset .shape [1 ] + 5 ))
121
121
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
@@ -124,13 +124,13 @@ def test_last_chunk_ndim(self):
124
124
125
125
@check_opt_slicing
126
126
def test_scalar_inside (self ):
127
- """ Reading a scalar inside of the array """
127
+ """Reading a scalar inside of the array"""
128
128
coord = tuple (random .randrange (0 , c ) for c in self .dset .shape )
129
129
self .assertEqual (self .dset [coord ], self .arr [coord ])
130
130
131
131
@check_opt_slicing
132
132
def test_scalar_outside (self ):
133
- """ Reading a scalar outside of the array """
133
+ """Reading a scalar outside of the array"""
134
134
shape = self .dset .shape
135
135
coords = [(shape [0 ] * 2 , 0 ), (0 , shape [1 ] * 2 ),
136
136
tuple (c * 2 for c in shape )]
@@ -140,7 +140,7 @@ def test_scalar_outside(self):
140
140
141
141
@check_opt_slicing
142
142
def test_slice_outside (self ):
143
- """ Reading a slice outside of the array (empty) """
143
+ """Reading a slice outside of the array (empty)"""
144
144
shape = self .dset .shape
145
145
slcs = [(slice (shape [0 ] * 2 , shape [0 ] * 3 ), ...),
146
146
(..., slice (shape [1 ] * 2 , shape [1 ] * 3 )),
@@ -150,14 +150,14 @@ def test_slice_outside(self):
150
150
151
151
@check_opt_slicing
152
152
def test_slice_1dimless (self ):
153
- """ Reading a slice with one dimension less than the array """
153
+ """Reading a slice with one dimension less than the array"""
154
154
idxs = [random .randrange (0 , dim ) for dim in self .dset .shape ]
155
155
for idx in idxs :
156
156
self .assertArrayEqual (self .dset [idx ], self .arr [idx ])
157
157
158
158
@check_opt_slicing
159
159
def test_astype (self ):
160
- """ Reading a slice converted to another type """
160
+ """Reading a slice converted to another type"""
161
161
alt_dtype = np .dtype ('u4' )
162
162
self .assertTrue (self .dset .dtype < alt_dtype )
163
163
alt_arr = self .arr .astype (alt_dtype )
@@ -220,7 +220,7 @@ def should_enable_opt(self):
220
220
221
221
@check_opt_slicing
222
222
def test_slice (self ):
223
- """ Reading a slice perpendicular to chunks """
223
+ """Reading a slice perpendicular to chunks"""
224
224
slc = (slice (1 , 2 ), slice (0 , 2 ), slice (0 , 2 ))
225
225
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
226
226
@@ -252,12 +252,12 @@ def should_enable_opt(self):
252
252
253
253
@check_opt_slicing
254
254
def test_whole_array (self ):
255
- """ Reading a slice covering the whole array """
255
+ """Reading a slice covering the whole array"""
256
256
self .assertArrayEqual (self .dset [:], self .arr )
257
257
258
258
@check_opt_slicing
259
259
def test_chunk (self ):
260
- """ Reading a slice matching a chunk """
260
+ """Reading a slice matching a chunk"""
261
261
slcs = [tuple (slice (mult * cl , (mult + 1 ) * cl )
262
262
for cl in self .dset .chunks )
263
263
for mult in range (3 )]
@@ -266,20 +266,20 @@ def test_chunk(self):
266
266
267
267
@check_opt_slicing
268
268
def test_cross_chunk (self ):
269
- """ Reading a slice crossing chunk boundaries """
269
+ """Reading a slice crossing chunk boundaries"""
270
270
slc = (slice (1 , 1 ), slice (3 , 3 ))
271
271
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
272
272
273
273
@check_opt_slicing
274
274
def test_last_chunk (self ):
275
- """ Reading a slice going past the last chunk """
275
+ """Reading a slice going past the last chunk"""
276
276
slc = (slice (- 1 , self .dset .shape [0 ] + 10 ),
277
277
slice (- 1 , self .dset .shape [1 ] + 10 ))
278
278
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
279
279
280
280
@check_opt_slicing
281
281
def test_cross_last_chunk (self ):
282
- """ Reading a slice crossing chunk boundaries past last chunk """
282
+ """Reading a slice crossing chunk boundaries past last chunk"""
283
283
slc = (slice (- 2 , self .dset .shape [0 ] + 10 ),
284
284
slice (- 2 , self .dset .shape [1 ] + 10 ))
285
285
self .assertArrayEqual (self .dset [slc ], self .arr [slc ])
0 commit comments