Skip to content

Commit 35327f1

Browse files
committed
add tests for byte order
1 parent ef2acb6 commit 35327f1

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

zarr/tests/test_array.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,21 +374,28 @@ def _test_persistence(self, a, chunks):
374374
shutil.rmtree(path)
375375

376376
def test_persistence_1d(self):
377+
377378
# simple dtype
378-
self._test_persistence(np.arange(1050), chunks=(100,))
379+
for dtype in '<i4', '>i4':
380+
a = np.arange(1050, dtype=dtype)
381+
self._test_persistence(a, chunks=(100,))
382+
379383
# structured dtype
380384
dtype = np.dtype([('a', 'i4'), ('b', 'S10')])
381-
self._test_persistence(np.empty(10000, dtype=dtype), chunks=(100,))
385+
a = np.empty(10000, dtype=dtype)
386+
self._test_persistence(a, chunks=(100,))
382387

383388
def test_persistence_2d(self):
384-
chunks = (100, 2)
389+
385390
# simple dtype
386-
a = np.arange(10000).reshape((1000, 10))
387-
self._test_persistence(a, chunks=chunks)
391+
for dtype in '<i4', '>i4':
392+
a = np.arange(10000, dtype=dtype).reshape((1000, 10))
393+
self._test_persistence(a, chunks=(100, 2))
394+
388395
# structured dtype
389396
dtype = np.dtype([('a', 'i4'), ('b', 'S10')])
390-
self._test_persistence(np.empty((1000, 10), dtype=dtype),
391-
chunks=chunks)
397+
a = np.empty((1000, 10), dtype=dtype)
398+
self._test_persistence(a, chunks=(100, 2))
392399

393400
def test_resize_persistence(self):
394401

0 commit comments

Comments
 (0)