From a620c44a657f40535e412577ff713fafd79a4c08 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Thu, 28 Mar 2019 04:53:52 -0400
Subject: [PATCH 7/8] Force test data to be little-endian.
The stored information in the fixtures says that they should be
little-endian.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
numcodecs/tests/test_delta.py | 8 ++++----
numcodecs/tests/test_fixedscaleoffset.py | 20 ++++++++++----------
numcodecs/tests/test_quantize.py | 20 ++++++++++----------
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/numcodecs/tests/test_delta.py b/numcodecs/tests/test_delta.py
index c163c73..5fb26a4 100644
--- a/numcodecs/tests/test_delta.py
+++ b/numcodecs/tests/test_delta.py
@@ -16,10 +16,10 @@ from numcodecs.tests.common import (check_encode_decode, check_config, check_rep
# mix of shapes: 1D, 2D, 3D
# mix of orders: C, F
arrays = [
- np.arange(1000, dtype='i4'),
- np.linspace(1000, 1001, 1000, dtype='f4').reshape(100, 10),
- np.random.normal(loc=1000, scale=1, size=(10, 10, 10)).astype('f8'),
- np.random.randint(0, 200, size=1000, dtype='u2').reshape(100, 10, order='F'),
+ np.arange(1000, dtype='<i4'),
+ np.linspace(1000, 1001, 1000, dtype='<f4').reshape(100, 10),
+ np.random.normal(loc=1000, scale=1, size=(10, 10, 10)).astype('<f8'),
+ np.random.randint(0, 200, size=1000, dtype='u2').astype('<u2').reshape(100, 10, order='F'),
]
diff --git a/numcodecs/tests/test_fixedscaleoffset.py b/numcodecs/tests/test_fixedscaleoffset.py
index c2e8d61..aa2ffde 100644
--- a/numcodecs/tests/test_fixedscaleoffset.py
+++ b/numcodecs/tests/test_fixedscaleoffset.py
@@ -14,20 +14,20 @@ from numcodecs.tests.common import (check_encode_decode, check_config, check_rep
arrays = [
- np.linspace(1000, 1001, 1000, dtype='f8'),
- np.random.normal(loc=1000, scale=1, size=1000).astype('f8'),
- np.linspace(1000, 1001, 1000, dtype='f8').reshape(100, 10),
- np.linspace(1000, 1001, 1000, dtype='f8').reshape(100, 10, order='F'),
- np.linspace(1000, 1001, 1000, dtype='f8').reshape(10, 10, 10),
+ np.linspace(1000, 1001, 1000, dtype='<f8'),
+ np.random.normal(loc=1000, scale=1, size=1000).astype('<f8'),
+ np.linspace(1000, 1001, 1000, dtype='<f8').reshape(100, 10),
+ np.linspace(1000, 1001, 1000, dtype='<f8').reshape(100, 10, order='F'),
+ np.linspace(1000, 1001, 1000, dtype='<f8').reshape(10, 10, 10),
]
codecs = [
- FixedScaleOffset(offset=1000, scale=10, dtype='f8', astype='i1'),
- FixedScaleOffset(offset=1000, scale=10**2, dtype='f8', astype='i2'),
- FixedScaleOffset(offset=1000, scale=10**6, dtype='f8', astype='i4'),
- FixedScaleOffset(offset=1000, scale=10**12, dtype='f8', astype='i8'),
- FixedScaleOffset(offset=1000, scale=10**12, dtype='f8'),
+ FixedScaleOffset(offset=1000, scale=10, dtype='<f8', astype='<i1'),
+ FixedScaleOffset(offset=1000, scale=10**2, dtype='<f8', astype='<i2'),
+ FixedScaleOffset(offset=1000, scale=10**6, dtype='<f8', astype='<i4'),
+ FixedScaleOffset(offset=1000, scale=10**12, dtype='<f8', astype='<i8'),
+ FixedScaleOffset(offset=1000, scale=10**12, dtype='<f8'),
]
diff --git a/numcodecs/tests/test_quantize.py b/numcodecs/tests/test_quantize.py
index e38d7c5..c1b4871 100644
--- a/numcodecs/tests/test_quantize.py
+++ b/numcodecs/tests/test_quantize.py
@@ -14,20 +14,20 @@ from numcodecs.tests.common import check_encode_decode, check_config, \
arrays = [
- np.linspace(100, 200, 1000, dtype='f8'),
- np.random.normal(loc=0, scale=1, size=1000).astype('f8'),
- np.linspace(100, 200, 1000, dtype='f8').reshape(100, 10),
- np.linspace(100, 200, 1000, dtype='f8').reshape(100, 10, order='F'),
- np.linspace(100, 200, 1000, dtype='f8').reshape(10, 10, 10),
+ np.linspace(100, 200, 1000, dtype='<f8'),
+ np.random.normal(loc=0, scale=1, size=1000).astype('<f8'),
+ np.linspace(100, 200, 1000, dtype='<f8').reshape(100, 10),
+ np.linspace(100, 200, 1000, dtype='<f8').reshape(100, 10, order='F'),
+ np.linspace(100, 200, 1000, dtype='<f8').reshape(10, 10, 10),
]
codecs = [
- Quantize(digits=-1, dtype='f8', astype='f2'),
- Quantize(digits=0, dtype='f8', astype='f2'),
- Quantize(digits=1, dtype='f8', astype='f2'),
- Quantize(digits=5, dtype='f8', astype='f4'),
- Quantize(digits=12, dtype='f8', astype='f8'),
+ Quantize(digits=-1, dtype='<f8', astype='<f2'),
+ Quantize(digits=0, dtype='<f8', astype='<f2'),
+ Quantize(digits=1, dtype='<f8', astype='<f2'),
+ Quantize(digits=5, dtype='<f8', astype='<f4'),
+ Quantize(digits=12, dtype='<f8', astype='<f8'),
]
--
2.20.1