Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast datetime and timedelta to signed 64-bit int #127

Merged
merged 6 commits into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Release notes
* Add codec :class:`numcodecs.gzip.GZip` to replace ``gzip`` alias for ``zlib``,
which was incorrect (by :user:`Jan Funke <funkey>`; :issue:`87`).

* Corrects handling of ``NaT`` in ``datetime64`` and ``timedelta64`` in various
compressors (by :user:`John Kirkham <jakirkham>`; :issue:`127`).

.. _release_0.5.5:

0.5.5
Expand Down
Binary file added fixture/blosc/array.09.npy
Binary file not shown.
Binary file added fixture/blosc/array.10.npy
Binary file not shown.
Binary file added fixture/blosc/array.11.npy
Binary file not shown.
Binary file added fixture/blosc/array.12.npy
Binary file not shown.
Binary file added fixture/blosc/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.05/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.05/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.05/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.05/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.06/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.06/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.06/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.06/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.07/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.07/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.07/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.07/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.08/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.08/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.08/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.08/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.09/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.09/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.09/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.09/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.10/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.10/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.10/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.10/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.11/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.11/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.11/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.11/encoded.12.dat
Binary file not shown.
Binary file added fixture/blosc/codec.12/encoded.09.dat
Binary file not shown.
Binary file added fixture/blosc/codec.12/encoded.10.dat
Binary file not shown.
Binary file added fixture/blosc/codec.12/encoded.11.dat
Binary file not shown.
Binary file added fixture/blosc/codec.12/encoded.12.dat
Binary file not shown.
Binary file added fixture/bz2/array.09.npy
Binary file not shown.
Binary file added fixture/bz2/array.10.npy
Binary file not shown.
Binary file added fixture/bz2/array.11.npy
Binary file not shown.
Binary file added fixture/bz2/array.12.npy
Binary file not shown.
Binary file added fixture/bz2/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/bz2/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/bz2/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/bz2/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/bz2/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/bz2/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/bz2/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/bz2/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/bz2/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/bz2/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/bz2/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/bz2/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/bz2/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/bz2/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/bz2/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/bz2/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/array.09.npy
Binary file not shown.
Binary file added fixture/gzip/array.10.npy
Binary file not shown.
Binary file added fixture/gzip/array.11.npy
Binary file not shown.
Binary file added fixture/gzip/array.12.npy
Binary file not shown.
Binary file added fixture/gzip/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/gzip/codec.05/encoded.09.dat
Binary file not shown.
Binary file added fixture/gzip/codec.05/encoded.10.dat
Binary file not shown.
Binary file added fixture/gzip/codec.05/encoded.11.dat
Binary file not shown.
Binary file added fixture/gzip/codec.05/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/array.09.npy
Binary file not shown.
Binary file added fixture/lz4/array.10.npy
Binary file not shown.
Binary file added fixture/lz4/array.11.npy
Binary file not shown.
Binary file added fixture/lz4/array.12.npy
Binary file not shown.
Binary file added fixture/lz4/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.05/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.05/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.05/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.05/encoded.12.dat
Binary file not shown.
Binary file added fixture/lz4/codec.06/encoded.09.dat
Binary file not shown.
Binary file added fixture/lz4/codec.06/encoded.10.dat
Binary file not shown.
Binary file added fixture/lz4/codec.06/encoded.11.dat
Binary file not shown.
Binary file added fixture/lz4/codec.06/encoded.12.dat
Binary file not shown.
Binary file added fixture/lzma/array.09.npy
Binary file not shown.
Binary file added fixture/lzma/array.10.npy
Binary file not shown.
Binary file added fixture/lzma/array.11.npy
Binary file not shown.
Binary file added fixture/lzma/array.12.npy
Binary file not shown.
Binary file added fixture/lzma/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/lzma/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/lzma/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/lzma/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/lzma/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/lzma/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/lzma/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/lzma/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/lzma/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/lzma/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/lzma/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/lzma/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/lzma/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/lzma/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/lzma/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/lzma/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/lzma/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/lzma/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/lzma/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/lzma/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/array.09.npy
Binary file not shown.
Binary file added fixture/zlib/array.10.npy
Binary file not shown.
Binary file added fixture/zlib/array.11.npy
Binary file not shown.
Binary file added fixture/zlib/array.12.npy
Binary file not shown.
Binary file added fixture/zlib/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/zlib/codec.05/encoded.09.dat
Binary file not shown.
Binary file added fixture/zlib/codec.05/encoded.10.dat
Binary file not shown.
Binary file added fixture/zlib/codec.05/encoded.11.dat
Binary file not shown.
Binary file added fixture/zlib/codec.05/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/array.09.npy
Binary file not shown.
Binary file added fixture/zstd/array.10.npy
Binary file not shown.
Binary file added fixture/zstd/array.11.npy
Binary file not shown.
Binary file added fixture/zstd/array.12.npy
Binary file not shown.
Binary file added fixture/zstd/codec.00/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.00/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.00/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.00/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.01/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.01/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.01/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.01/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.02/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.02/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.02/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.02/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.03/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.03/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.03/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.03/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.04/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.04/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.04/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.04/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.05/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.05/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.05/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.05/encoded.12.dat
Binary file not shown.
Binary file added fixture/zstd/codec.06/encoded.09.dat
Binary file not shown.
Binary file added fixture/zstd/codec.06/encoded.10.dat
Binary file not shown.
Binary file added fixture/zstd/codec.06/encoded.11.dat
Binary file not shown.
Binary file added fixture/zstd/codec.06/encoded.12.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion numcodecs/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ def ensure_text(l, encoding='utf-8'):

def handle_datetime(buf):
if hasattr(buf, 'dtype') and buf.dtype.kind in 'Mm':
return buf.view('u8')
return buf.view('i8')
return buf
26 changes: 13 additions & 13 deletions numcodecs/compat_ext.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion numcodecs/compat_ext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cdef class Buffer:
self.released = False
if hasattr(obj, 'dtype'):
if obj.dtype.kind in 'Mm':
obj = obj.view('u8')
obj = obj.view('i8')
elif obj.dtype.kind == 'O':
raise ValueError('cannot obtain buffer from object array')
if PY2 and isinstance(obj, array.array):
Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_blosc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
Copy link
Member

@alimanfoo alimanfoo Nov 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest, if this is random numbers between -2**30 and 2**30, why do we need to take the negative of the array? Is it not enough to specify the limits within randint?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. This wasn't correct.

Basically NaT in float64 is the same as -0.0. However int64 lacks a -0 equivalent, but -2**63 maps to the same value, which is what we want to include.

PR ( #131 ) fixes this.

(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_bz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_lz4.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_lzma.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down
4 changes: 4 additions & 0 deletions numcodecs/tests/test_zstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
np.random.randint(0, 2**60, size=1000, dtype='u8').view('m8[ns]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('M8[m]'),
np.random.randint(0, 2**25, size=1000, dtype='u8').view('m8[m]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('M8[ns]'),
(-np.random.randint(-2**30, 2**30, size=1000, dtype='i8')).view('m8[ns]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('M8[m]'),
(-np.random.randint(-2**12, 2**13, size=1000, dtype='i8')).view('m8[m]'),
]


Expand Down