Skip to content

Commit 3ab36eb

Browse files
jakirkhamjeromekelleher
authored andcommitted
Switch ABC to use ensure_ndarray to get nbytes
1 parent 48582a5 commit 3ab36eb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

numcodecs/abc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
"""
3232
from __future__ import absolute_import, print_function, division
33-
from numcodecs.compat import handle_datetime
33+
from numcodecs.compat import ensure_ndarray
3434

3535

3636
class Codec(object):
@@ -46,8 +46,7 @@ class Codec(object):
4646
"""Maximum size of a buffer that can be encoded or decoded."""
4747

4848
def _check_buffer_size(self, buf):
49-
buf = handle_datetime(buf)
50-
bufsize = memoryview(buf).nbytes
49+
bufsize = ensure_ndarray(buf).nbytes
5150
if bufsize > self.max_buffer_size:
5251
msg = "{} codec does not support buffers of > {} bytes".format(
5352
self.codec_id, self.max_buffer_size)

0 commit comments

Comments
 (0)