Skip to content

Commit e4f9152

Browse files
Added max_buffer_size to ensure_contiguous_ndarray.
Reverted earlier changes to the ABC layer as converting to ndarray and checking buffer size seems pointless and inefficient.
1 parent 3ab36eb commit e4f9152

File tree

10 files changed

+1186
-1770
lines changed

10 files changed

+1186
-1770
lines changed

numcodecs/abc.py

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

3534

3635
class Codec(object):
@@ -40,18 +39,6 @@ class Codec(object):
4039
codec_id = None
4140
"""Codec identifier."""
4241

43-
# 2GiB limit by default. Codecs can override this in subclasses if larger
44-
# buffers are supported.
45-
max_buffer_size = 2**31 - 1
46-
"""Maximum size of a buffer that can be encoded or decoded."""
47-
48-
def _check_buffer_size(self, buf):
49-
bufsize = ensure_ndarray(buf).nbytes
50-
if bufsize > self.max_buffer_size:
51-
msg = "{} codec does not support buffers of > {} bytes".format(
52-
self.codec_id, self.max_buffer_size)
53-
raise ValueError(msg)
54-
5542
def encode(self, buf): # pragma: no cover
5643
"""Encode data in `buf`.
5744

0 commit comments

Comments
 (0)