Skip to content

Commit b41df41

Browse files
authored
Merge pull request #139 from alimanfoo/investigate-138-alimanfoo-20181129
Fix issue with fixture generation
2 parents d3c0f01 + af5cf10 commit b41df41

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

numcodecs/tests/common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,15 @@ def check_backwards_compatibility(codec_id, arrays, codecs, precision=None, pref
215215
# one time encode and save array
216216
if not os.path.exists(enc_fn): # pragma: no cover
217217
enc = codec.encode(arr)
218+
enc = ensure_bytes(enc)
218219
with open(enc_fn, mode='wb') as ef:
219220
ef.write(enc)
220221

221222
# load and decode data
222223
with open(enc_fn, mode='rb') as ef:
223224
enc = ef.read()
224225
dec = codec.decode(enc)
225-
if isinstance(dec, np.ndarray):
226-
dec_arr = dec.reshape(-1, order='A')
227-
else:
228-
dec_arr = ensure_ndarray(dec)
226+
dec_arr = ensure_ndarray(dec).reshape(-1, order='A')
229227
dec_arr = dec_arr.view(dtype=arr.dtype).reshape(arr.shape, order=order)
230228
if precision and precision[j] is not None:
231229
assert_array_almost_equal(arr, dec_arr, decimal=precision[j])

0 commit comments

Comments
 (0)