diff --git a/docs/blosc.rst b/docs/blosc.rst index 29c0fa37..4a7681c9 100644 --- a/docs/blosc.rst +++ b/docs/blosc.rst @@ -13,6 +13,7 @@ Blosc .. automethod:: decode .. automethod:: get_config .. automethod:: from_config + .. automethod:: decode_partial Helper functions ---------------- @@ -28,3 +29,4 @@ Helper functions .. autofunction:: cbuffer_metainfo .. autofunction:: compress .. autofunction:: decompress +.. autofunction:: decompress_partial diff --git a/docs/release.rst b/docs/release.rst index e7b123d6..35cf36f5 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -4,6 +4,9 @@ Release notes Upcoming Release ---------------- +* Add partial decompression of Blosc compressed arrays. + By :user:`Andrew Fulton `, :issue:`235`. + * Remove LegacyJSON codec. By :user:`James Bourbeau `, :issue:`226`. diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index fd5ef882..c9e13dbe 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -25,81 +25,87 @@ "c-blosc/blosc/blosc.h" ], "extra_compile_args": [ - "-stdlib=libc++", - "-DSHUFFLE_SSE2_ENABLED" + "-msse2", + "-mavx2", + "-DSHUFFLE_SSE2_ENABLED", + "-DSHUFFLE_AVX2_ENABLED" ], "include_dirs": [ "c-blosc/blosc", - "c-blosc/internal-complibs/lz4-1.9.1", - "c-blosc/internal-complibs/snappy-1.1.1", - "c-blosc/internal-complibs/zstd-1.4.1", + "c-blosc/internal-complibs/zstd-1.4.4", + "c-blosc/internal-complibs/lz4-1.9.2", "c-blosc/internal-complibs/zlib-1.2.8", - "c-blosc/internal-complibs/zstd-1.4.1/compress", - "c-blosc/internal-complibs/zstd-1.4.1/dictBuilder", - "c-blosc/internal-complibs/zstd-1.4.1/decompress", - "c-blosc/internal-complibs/zstd-1.4.1/legacy", - "c-blosc/internal-complibs/zstd-1.4.1/common", - "c-blosc/internal-complibs/zstd-1.4.1/dll", - "c-blosc/internal-complibs/zstd-1.4.1/deprecated" + "c-blosc/internal-complibs/snappy-1.1.1", + "c-blosc/internal-complibs/zstd-1.4.4/common", + "c-blosc/internal-complibs/zstd-1.4.4/deprecated", + "c-blosc/internal-complibs/zstd-1.4.4/dictBuilder", + "c-blosc/internal-complibs/zstd-1.4.4/compress", + "c-blosc/internal-complibs/zstd-1.4.4/decompress", + "c-blosc/internal-complibs/zstd-1.4.4/dll", + "c-blosc/internal-complibs/zstd-1.4.4/legacy" ], "name": "numcodecs.blosc", "sources": [ "numcodecs/blosc.pyx", - "c-blosc/blosc/blosc.c", - "c-blosc/blosc/bitshuffle-generic.c", "c-blosc/blosc/shuffle.c", "c-blosc/blosc/fastcopy.c", "c-blosc/blosc/blosclz.c", "c-blosc/blosc/shuffle-generic.c", - "c-blosc/internal-complibs/lz4-1.9.1/lz4hc.c", - "c-blosc/internal-complibs/lz4-1.9.1/lz4.c", - "c-blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.cc", + "c-blosc/blosc/blosc.c", + "c-blosc/blosc/bitshuffle-generic.c", + "c-blosc/internal-complibs/lz4-1.9.2/lz4hc.c", + "c-blosc/internal-complibs/lz4-1.9.2/lz4.c", "c-blosc/internal-complibs/snappy-1.1.1/snappy-c.cc", - "c-blosc/internal-complibs/snappy-1.1.1/snappy-sinksource.cc", "c-blosc/internal-complibs/snappy-1.1.1/snappy.cc", - "c-blosc/internal-complibs/zlib-1.2.8/inflate.c", - "c-blosc/internal-complibs/zlib-1.2.8/compress.c", - "c-blosc/internal-complibs/zlib-1.2.8/deflate.c", - "c-blosc/internal-complibs/zlib-1.2.8/gzread.c", + "c-blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.cc", + "c-blosc/internal-complibs/snappy-1.1.1/snappy-sinksource.cc", + "c-blosc/internal-complibs/zlib-1.2.8/trees.c", + "c-blosc/internal-complibs/zlib-1.2.8/zutil.c", "c-blosc/internal-complibs/zlib-1.2.8/crc32.c", + "c-blosc/internal-complibs/zlib-1.2.8/inflate.c", "c-blosc/internal-complibs/zlib-1.2.8/infback.c", - "c-blosc/internal-complibs/zlib-1.2.8/zutil.c", + "c-blosc/internal-complibs/zlib-1.2.8/gzclose.c", + "c-blosc/internal-complibs/zlib-1.2.8/adler32.c", "c-blosc/internal-complibs/zlib-1.2.8/gzlib.c", - "c-blosc/internal-complibs/zlib-1.2.8/inftrees.c", + "c-blosc/internal-complibs/zlib-1.2.8/inffast.c", + "c-blosc/internal-complibs/zlib-1.2.8/gzread.c", + "c-blosc/internal-complibs/zlib-1.2.8/deflate.c", "c-blosc/internal-complibs/zlib-1.2.8/uncompr.c", + "c-blosc/internal-complibs/zlib-1.2.8/inftrees.c", + "c-blosc/internal-complibs/zlib-1.2.8/compress.c", "c-blosc/internal-complibs/zlib-1.2.8/gzwrite.c", - "c-blosc/internal-complibs/zlib-1.2.8/trees.c", - "c-blosc/internal-complibs/zlib-1.2.8/gzclose.c", - "c-blosc/internal-complibs/zlib-1.2.8/inffast.c", - "c-blosc/internal-complibs/zlib-1.2.8/adler32.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/entropy_common.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/fse_decompress.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/debug.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/xxhash.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/pool.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/threading.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/zstd_common.c", - "c-blosc/internal-complibs/zstd-1.4.1/common/error_private.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstdmt_compress.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_double_fast.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_fast.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_ldm.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/hist.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_compress.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_lazy.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/huf_compress.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/zstd_opt.c", - "c-blosc/internal-complibs/zstd-1.4.1/compress/fse_compress.c", - "c-blosc/internal-complibs/zstd-1.4.1/decompress/zstd_ddict.c", - "c-blosc/internal-complibs/zstd-1.4.1/decompress/huf_decompress.c", - "c-blosc/internal-complibs/zstd-1.4.1/decompress/zstd_decompress.c", - "c-blosc/internal-complibs/zstd-1.4.1/decompress/zstd_decompress_block.c", - "c-blosc/internal-complibs/zstd-1.4.1/dictBuilder/cover.c", - "c-blosc/internal-complibs/zstd-1.4.1/dictBuilder/divsufsort.c", - "c-blosc/internal-complibs/zstd-1.4.1/dictBuilder/fastcover.c", - "c-blosc/internal-complibs/zstd-1.4.1/dictBuilder/zdict.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/debug.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/pool.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/error_private.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/entropy_common.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/zstd_common.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/threading.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/xxhash.c", + "c-blosc/internal-complibs/zstd-1.4.4/common/fse_decompress.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_lazy.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstdmt_compress.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_compress_sequences.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_opt.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_compress.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/fse_compress.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/huf_compress.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/hist.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_fast.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_ldm.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_double_fast.c", + "c-blosc/internal-complibs/zstd-1.4.4/compress/zstd_compress_literals.c", + "c-blosc/internal-complibs/zstd-1.4.4/decompress/zstd_ddict.c", + "c-blosc/internal-complibs/zstd-1.4.4/decompress/huf_decompress.c", + "c-blosc/internal-complibs/zstd-1.4.4/decompress/zstd_decompress.c", + "c-blosc/internal-complibs/zstd-1.4.4/decompress/zstd_decompress_block.c", + "c-blosc/internal-complibs/zstd-1.4.4/dictBuilder/fastcover.c", + "c-blosc/internal-complibs/zstd-1.4.4/dictBuilder/divsufsort.c", + "c-blosc/internal-complibs/zstd-1.4.4/dictBuilder/cover.c", + "c-blosc/internal-complibs/zstd-1.4.4/dictBuilder/zdict.c", + "c-blosc/blosc/shuffle-sse2.c", "c-blosc/blosc/bitshuffle-sse2.c", - "c-blosc/blosc/shuffle-sse2.c" + "c-blosc/blosc/bitshuffle-avx2.c", + "c-blosc/blosc/shuffle-avx2.c" ] }, "module_name": "numcodecs.blosc" @@ -906,7 +912,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/blosc.pyx", - "type.pxd", + ".tox/py36/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ @@ -1284,6 +1290,31 @@ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char); +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); + /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); @@ -1313,28 +1344,6 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); @@ -1476,12 +1485,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1567,6 +1576,7 @@ static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_mutex[] = "mutex"; static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; static const char __pyx_k_Buffer[] = "Buffer"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_cbytes[] = "cbytes"; @@ -1580,6 +1590,7 @@ static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_nbytes[] = "nbytes"; +static const char __pyx_k_nitems[] = "nitems"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_OSError[] = "OSError"; static const char __pyx_k_SHUFFLE[] = "SHUFFLE"; @@ -1620,6 +1631,7 @@ static const char __pyx_k_cname_bytes[] = "_cname_bytes"; static const char __pyx_k_dest_buffer[] = "dest_buffer"; static const char __pyx_k_dest_nbytes[] = "dest_nbytes"; static const char __pyx_k_main_thread[] = "main_thread"; +static const char __pyx_k_start_bytes[] = "start_bytes"; static const char __pyx_k_use_threads[] = "use_threads"; static const char __pyx_k_Blosc___init[] = "Blosc.__init__"; static const char __pyx_k_Blosc___repr[] = "Blosc.__repr__"; @@ -1631,9 +1643,11 @@ static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_VERSION_DATE[] = "VERSION_DATE"; static const char __pyx_k_get_nthreads[] = "get_nthreads"; static const char __pyx_k_importer_pid[] = "_importer_pid"; +static const char __pyx_k_nitems_bytes[] = "nitems_bytes"; static const char __pyx_k_set_nthreads[] = "set_nthreads"; static const char __pyx_k_shuffle_repr[] = "_shuffle_repr"; static const char __pyx_k_cbuffer_sizes[] = "cbuffer_sizes"; +static const char __pyx_k_encoding_size[] = "encoding_size"; static const char __pyx_k_err_bad_cname[] = "err_bad_cname"; static const char __pyx_k_source_buffer[] = "source_buffer"; static const char __pyx_k_use_threads_2[] = "_use_threads"; @@ -1641,6 +1655,7 @@ static const char __pyx_k_MAX_BUFFERSIZE[] = "MAX_BUFFERSIZE"; static const char __pyx_k_VERSION_STRING[] = "VERSION_STRING"; static const char __pyx_k_compressor_set[] = "compressor_set"; static const char __pyx_k_current_thread[] = "current_thread"; +static const char __pyx_k_decode_partial[] = "decode_partial"; static const char __pyx_k_cbuffer_complib[] = "cbuffer_complib"; static const char __pyx_k_current_process[] = "current_process"; static const char __pyx_k_expected_one_of[] = "; expected one of "; @@ -1651,7 +1666,9 @@ static const char __pyx_k_numcodecs_blosc[] = "numcodecs.blosc"; static const char __pyx_k_cbuffer_metainfo[] = "cbuffer_metainfo"; static const char __pyx_k_list_compressors[] = "list_compressors"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_decompress_partial[] = "decompress_partial"; static const char __pyx_k_numcodecs_blosc_pyx[] = "numcodecs/blosc.pyx"; +static const char __pyx_k_Blosc_decode_partial[] = "Blosc.decode_partial"; static const char __pyx_k_compname_to_compcode[] = "compname_to_compcode"; static const char __pyx_k_ensure_contiguous_ndarray[] = "ensure_contiguous_ndarray"; static const char __pyx_k_Codec_providing_compression_usin[] = "Codec providing compression using the Blosc meta-compressor.\n\n Parameters\n ----------\n cname : string, optional\n A string naming one of the compression algorithms available within blosc, e.g.,\n 'zstd', 'blosclz', 'lz4', 'lz4hc', 'zlib' or 'snappy'.\n clevel : integer, optional\n An integer between 0 and 9 specifying the compression level.\n shuffle : integer, optional\n Either NOSHUFFLE (0), SHUFFLE (1), BITSHUFFLE (2) or AUTOSHUFFLE (-1). If -1\n (default), bit-shuffle will be used for buffers with itemsize 1,\n and byte-shuffle will be used otherwise.\n blocksize : int\n The requested size of the compressed blocks. If 0 (default), an automatic\n blocksize will be used.\n\n See Also\n --------\n numcodecs.zstd.Zstd, numcodecs.lz4.LZ4\n\n "; @@ -1659,6 +1676,7 @@ static const char __pyx_k_bad_compressor_or_compressor_not[] = "bad compressor o static const char __pyx_k_destination_buffer_too_small_exp[] = "destination buffer too small; expected at least "; static const char __pyx_k_error_during_blosc_compression_d[] = "error during blosc compression: %d"; static const char __pyx_k_error_during_blosc_decompression[] = "error during blosc decompression: %d"; +static const char __pyx_k_error_during_blosc_partial_decom[] = "error during blosc partial decompression: %d"; static const char __pyx_k_invalid_shuffle_argument_expecte[] = "invalid shuffle argument; expected -1, 0, 1 or 2, found %r"; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_AUTOBLOCKS; @@ -1670,6 +1688,7 @@ static PyObject *__pyx_n_s_Blosc; static PyObject *__pyx_n_s_Blosc___init; static PyObject *__pyx_n_s_Blosc___repr; static PyObject *__pyx_n_s_Blosc_decode; +static PyObject *__pyx_n_s_Blosc_decode_partial; static PyObject *__pyx_n_s_Blosc_encode; static PyObject *__pyx_n_s_Buffer; static PyObject *__pyx_n_s_Codec; @@ -1721,7 +1740,9 @@ static PyObject *__pyx_n_s_compressor_set; static PyObject *__pyx_n_s_current_process; static PyObject *__pyx_n_s_current_thread; static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_decode_partial; static PyObject *__pyx_n_s_decompress; +static PyObject *__pyx_n_s_decompress_partial; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_dest_buffer; static PyObject *__pyx_n_s_dest_nbytes; @@ -1730,11 +1751,13 @@ static PyObject *__pyx_kp_u_destination_buffer_too_small_exp; static PyObject *__pyx_n_s_destroy; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding_size; static PyObject *__pyx_n_s_ensure_contiguous_ndarray; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_err_bad_cname; static PyObject *__pyx_kp_u_error_during_blosc_compression_d; static PyObject *__pyx_kp_u_error_during_blosc_decompression; +static PyObject *__pyx_kp_u_error_during_blosc_partial_decom; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_kp_u_expected_one_of; static PyObject *__pyx_n_s_flags; @@ -1762,6 +1785,8 @@ static PyObject *__pyx_n_s_mutex; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_nbytes; +static PyObject *__pyx_n_s_nitems; +static PyObject *__pyx_n_s_nitems_bytes; static PyObject *__pyx_n_s_nthreads; static PyObject *__pyx_n_s_numcodecs_blosc; static PyObject *__pyx_kp_s_numcodecs_blosc_pyx; @@ -1785,6 +1810,8 @@ static PyObject *__pyx_n_s_source; static PyObject *__pyx_n_s_source_buffer; static PyObject *__pyx_n_s_source_ptr; static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_bytes; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_typesize; @@ -1803,12 +1830,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cname); /* proto */ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, char *__pyx_v_cname, int __pyx_v_clevel, int __pyx_v_shuffle, int __pyx_v_blocksize); /* proto */ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_dest); /* proto */ -static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_9numcodecs_5blosc_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_dest); /* proto */ +static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cname, PyObject *__pyx_v_clevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_blocksize); /* proto */ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_out); /* proto */ -static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, int __pyx_v_start, int __pyx_v_nitems, PyObject *__pyx_v_out); /* proto */ +static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_5; @@ -1831,7 +1860,10 @@ static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__35; -static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; @@ -1848,10 +1880,12 @@ static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; -static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__42; /* Late includes */ -/* "numcodecs/blosc.pyx":86 +/* "numcodecs/blosc.pyx":87 * * * def init(): # <<<<<<<<<<<<<< @@ -1879,7 +1913,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_init(CYTHON_UNUSED PyObject *__pyx_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); - /* "numcodecs/blosc.pyx":88 + /* "numcodecs/blosc.pyx":89 * def init(): * """Initialize the Blosc library environment.""" * blosc_init() # <<<<<<<<<<<<<< @@ -1888,7 +1922,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_init(CYTHON_UNUSED PyObject *__pyx_s */ blosc_init(); - /* "numcodecs/blosc.pyx":86 + /* "numcodecs/blosc.pyx":87 * * * def init(): # <<<<<<<<<<<<<< @@ -1903,7 +1937,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_init(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "numcodecs/blosc.pyx":91 +/* "numcodecs/blosc.pyx":92 * * * def destroy(): # <<<<<<<<<<<<<< @@ -1931,7 +1965,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_2destroy(CYTHON_UNUSED PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy", 0); - /* "numcodecs/blosc.pyx":93 + /* "numcodecs/blosc.pyx":94 * def destroy(): * """Destroy the Blosc library environment.""" * blosc_destroy() # <<<<<<<<<<<<<< @@ -1940,7 +1974,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_2destroy(CYTHON_UNUSED PyObject *__p */ blosc_destroy(); - /* "numcodecs/blosc.pyx":91 + /* "numcodecs/blosc.pyx":92 * * * def destroy(): # <<<<<<<<<<<<<< @@ -1955,7 +1989,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_2destroy(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "numcodecs/blosc.pyx":96 +/* "numcodecs/blosc.pyx":97 * * * def compname_to_compcode(cname): # <<<<<<<<<<<<<< @@ -1990,7 +2024,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED __Pyx_RefNannySetupContext("compname_to_compcode", 0); __Pyx_INCREF(__pyx_v_cname); - /* "numcodecs/blosc.pyx":100 + /* "numcodecs/blosc.pyx":101 * name is not recognized, or there is not support for it in this build, -1 is returned * instead.""" * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -2001,14 +2035,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "numcodecs/blosc.pyx":101 + /* "numcodecs/blosc.pyx":102 * instead.""" * if isinstance(cname, str): * cname = cname.encode('ascii') # <<<<<<<<<<<<<< * return blosc_compname_to_compcode(cname) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -2022,13 +2056,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_cname, __pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":100 + /* "numcodecs/blosc.pyx":101 * name is not recognized, or there is not support for it in this build, -1 is returned * instead.""" * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -2037,7 +2071,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED */ } - /* "numcodecs/blosc.pyx":102 + /* "numcodecs/blosc.pyx":103 * if isinstance(cname, str): * cname = cname.encode('ascii') * return blosc_compname_to_compcode(cname) # <<<<<<<<<<<<<< @@ -2045,14 +2079,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_From_int(blosc_compname_to_compcode(__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(blosc_compname_to_compcode(__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":96 + /* "numcodecs/blosc.pyx":97 * * * def compname_to_compcode(cname): # <<<<<<<<<<<<<< @@ -2074,7 +2108,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_4compname_to_compcode(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":105 +/* "numcodecs/blosc.pyx":106 * * * def list_compressors(): # <<<<<<<<<<<<<< @@ -2106,26 +2140,26 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_6list_compressors(CYTHON_UNUSED PyOb PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("list_compressors", 0); - /* "numcodecs/blosc.pyx":107 + /* "numcodecs/blosc.pyx":108 * def list_compressors(): * """Get a list of compressors supported in the current build.""" * s = blosc_list_compressors() # <<<<<<<<<<<<<< * s = s.decode('ascii') * return s.split(',') */ - __pyx_t_1 = __Pyx_PyBytes_FromString(blosc_list_compressors()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(blosc_list_compressors()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":108 + /* "numcodecs/blosc.pyx":109 * """Get a list of compressors supported in the current build.""" * s = blosc_list_compressors() * s = s.decode('ascii') # <<<<<<<<<<<<<< * return s.split(',') * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2139,13 +2173,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_6list_compressors(CYTHON_UNUSED PyOb } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":109 + /* "numcodecs/blosc.pyx":110 * s = blosc_list_compressors() * s = s.decode('ascii') * return s.split(',') # <<<<<<<<<<<<<< @@ -2153,7 +2187,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_6list_compressors(CYTHON_UNUSED PyOb * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2167,14 +2201,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_6list_compressors(CYTHON_UNUSED PyOb } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":105 + /* "numcodecs/blosc.pyx":106 * * * def list_compressors(): # <<<<<<<<<<<<<< @@ -2196,7 +2230,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_6list_compressors(CYTHON_UNUSED PyOb return __pyx_r; } -/* "numcodecs/blosc.pyx":112 +/* "numcodecs/blosc.pyx":113 * * * def get_nthreads(): # <<<<<<<<<<<<<< @@ -2225,7 +2259,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_8get_nthreads(CYTHON_UNUSED PyObject PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_nthreads", 0); - /* "numcodecs/blosc.pyx":115 + /* "numcodecs/blosc.pyx":116 * """Get the number of threads that Blosc uses internally for compression and * decompression.""" * return blosc_get_nthreads() # <<<<<<<<<<<<<< @@ -2233,13 +2267,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_8get_nthreads(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(blosc_get_nthreads()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(blosc_get_nthreads()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":112 + /* "numcodecs/blosc.pyx":113 * * * def get_nthreads(): # <<<<<<<<<<<<<< @@ -2258,7 +2292,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_8get_nthreads(CYTHON_UNUSED PyObject return __pyx_r; } -/* "numcodecs/blosc.pyx":118 +/* "numcodecs/blosc.pyx":119 * * * def set_nthreads(int nthreads): # <<<<<<<<<<<<<< @@ -2276,7 +2310,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_11set_nthreads(PyObject *__pyx_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_nthreads (wrapper)", 0); assert(__pyx_arg_nthreads); { - __pyx_v_nthreads = __Pyx_PyInt_As_int(__pyx_arg_nthreads); if (unlikely((__pyx_v_nthreads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_v_nthreads = __Pyx_PyInt_As_int(__pyx_arg_nthreads); if (unlikely((__pyx_v_nthreads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -2297,7 +2331,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_10set_nthreads(CYTHON_UNUSED PyObjec PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_nthreads", 0); - /* "numcodecs/blosc.pyx":121 + /* "numcodecs/blosc.pyx":122 * """Set the number of threads that Blosc uses internally for compression and * decompression.""" * return blosc_set_nthreads(nthreads) # <<<<<<<<<<<<<< @@ -2305,13 +2339,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_10set_nthreads(CYTHON_UNUSED PyObjec * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(blosc_set_nthreads(__pyx_v_nthreads)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(blosc_set_nthreads(__pyx_v_nthreads)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":118 + /* "numcodecs/blosc.pyx":119 * * * def set_nthreads(int nthreads): # <<<<<<<<<<<<<< @@ -2330,7 +2364,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_10set_nthreads(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":124 +/* "numcodecs/blosc.pyx":125 * * * def cbuffer_sizes(source): # <<<<<<<<<<<<<< @@ -2366,16 +2400,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("cbuffer_sizes", 0); - /* "numcodecs/blosc.pyx":141 + /* "numcodecs/blosc.pyx":142 * * # obtain buffer * buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< * * # determine buffer size */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -2383,13 +2417,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":144 + /* "numcodecs/blosc.pyx":145 * * # determine buffer size * blosc_cbuffer_sizes(buffer.ptr, &nbytes, &cbytes, &blocksize) # <<<<<<<<<<<<<< @@ -2398,18 +2432,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje */ blosc_cbuffer_sizes(__pyx_v_buffer->ptr, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize)); - /* "numcodecs/blosc.pyx":147 + /* "numcodecs/blosc.pyx":148 * * # release buffers * buffer.release() # <<<<<<<<<<<<<< * * return nbytes, cbytes, blocksize */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":149 + /* "numcodecs/blosc.pyx":150 * buffer.release() * * return nbytes, cbytes, blocksize # <<<<<<<<<<<<<< @@ -2417,13 +2451,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -2438,7 +2472,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje __pyx_t_4 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":124 + /* "numcodecs/blosc.pyx":125 * * * def cbuffer_sizes(source): # <<<<<<<<<<<<<< @@ -2461,7 +2495,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_12cbuffer_sizes(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":152 +/* "numcodecs/blosc.pyx":153 * * * def cbuffer_complib(source): # <<<<<<<<<<<<<< @@ -2494,16 +2528,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_14cbuffer_complib(CYTHON_UNUSED PyOb PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("cbuffer_complib", 0); - /* "numcodecs/blosc.pyx":158 + /* "numcodecs/blosc.pyx":159 * * # obtain buffer * buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< * * # determine buffer size */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -2511,43 +2545,43 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_14cbuffer_complib(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":161 + /* "numcodecs/blosc.pyx":162 * * # determine buffer size * complib = blosc_cbuffer_complib(buffer.ptr) # <<<<<<<<<<<<<< * * # release buffers */ - __pyx_t_1 = __Pyx_PyBytes_FromString(blosc_cbuffer_complib(__pyx_v_buffer->ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(blosc_cbuffer_complib(__pyx_v_buffer->ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_complib = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":164 + /* "numcodecs/blosc.pyx":165 * * # release buffers * buffer.release() # <<<<<<<<<<<<<< * * complib = complib.decode('ascii') */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":166 + /* "numcodecs/blosc.pyx":167 * buffer.release() * * complib = complib.decode('ascii') # <<<<<<<<<<<<<< * * return complib */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_complib, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_complib, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2561,13 +2595,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_14cbuffer_complib(CYTHON_UNUSED PyOb } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_complib, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":168 + /* "numcodecs/blosc.pyx":169 * complib = complib.decode('ascii') * * return complib # <<<<<<<<<<<<<< @@ -2579,7 +2613,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_14cbuffer_complib(CYTHON_UNUSED PyOb __pyx_r = __pyx_v_complib; goto __pyx_L0; - /* "numcodecs/blosc.pyx":152 + /* "numcodecs/blosc.pyx":153 * * * def cbuffer_complib(source): # <<<<<<<<<<<<<< @@ -2602,7 +2636,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_14cbuffer_complib(CYTHON_UNUSED PyOb return __pyx_r; } -/* "numcodecs/blosc.pyx":171 +/* "numcodecs/blosc.pyx":172 * * * def cbuffer_metainfo(source): # <<<<<<<<<<<<<< @@ -2639,16 +2673,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("cbuffer_metainfo", 0); - /* "numcodecs/blosc.pyx":189 + /* "numcodecs/blosc.pyx":190 * * # obtain buffer * buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< * * # determine buffer size */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -2656,13 +2690,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":192 + /* "numcodecs/blosc.pyx":193 * * # determine buffer size * blosc_cbuffer_metainfo(buffer.ptr, &typesize, &flags) # <<<<<<<<<<<<<< @@ -2671,18 +2705,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO */ blosc_cbuffer_metainfo(__pyx_v_buffer->ptr, (&__pyx_v_typesize), (&__pyx_v_flags)); - /* "numcodecs/blosc.pyx":195 + /* "numcodecs/blosc.pyx":196 * * # release buffers * buffer.release() # <<<<<<<<<<<<<< * * # decompose flags */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_buffer->__pyx_vtab)->release(__pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":198 + /* "numcodecs/blosc.pyx":199 * * # decompose flags * if flags & BLOSC_DOSHUFFLE: # <<<<<<<<<<<<<< @@ -2692,19 +2726,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_flags & BLOSC_DOSHUFFLE) != 0); if (__pyx_t_3) { - /* "numcodecs/blosc.pyx":199 + /* "numcodecs/blosc.pyx":200 * # decompose flags * if flags & BLOSC_DOSHUFFLE: * shuffle = SHUFFLE # <<<<<<<<<<<<<< * elif flags & BLOSC_DOBITSHUFFLE: * shuffle = BITSHUFFLE */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shuffle = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":198 + /* "numcodecs/blosc.pyx":199 * * # decompose flags * if flags & BLOSC_DOSHUFFLE: # <<<<<<<<<<<<<< @@ -2714,7 +2748,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO goto __pyx_L3; } - /* "numcodecs/blosc.pyx":200 + /* "numcodecs/blosc.pyx":201 * if flags & BLOSC_DOSHUFFLE: * shuffle = SHUFFLE * elif flags & BLOSC_DOBITSHUFFLE: # <<<<<<<<<<<<<< @@ -2724,19 +2758,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_flags & BLOSC_DOBITSHUFFLE) != 0); if (__pyx_t_3) { - /* "numcodecs/blosc.pyx":201 + /* "numcodecs/blosc.pyx":202 * shuffle = SHUFFLE * elif flags & BLOSC_DOBITSHUFFLE: * shuffle = BITSHUFFLE # <<<<<<<<<<<<<< * else: * shuffle = NOSHUFFLE */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shuffle = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":200 + /* "numcodecs/blosc.pyx":201 * if flags & BLOSC_DOSHUFFLE: * shuffle = SHUFFLE * elif flags & BLOSC_DOBITSHUFFLE: # <<<<<<<<<<<<<< @@ -2746,7 +2780,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO goto __pyx_L3; } - /* "numcodecs/blosc.pyx":203 + /* "numcodecs/blosc.pyx":204 * shuffle = BITSHUFFLE * else: * shuffle = NOSHUFFLE # <<<<<<<<<<<<<< @@ -2754,14 +2788,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO * */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NOSHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NOSHUFFLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shuffle = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; - /* "numcodecs/blosc.pyx":204 + /* "numcodecs/blosc.pyx":205 * else: * shuffle = NOSHUFFLE * memcpyed = flags & BLOSC_MEMCPYED # <<<<<<<<<<<<<< @@ -2770,7 +2804,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO */ __pyx_v_memcpyed = (__pyx_v_flags & BLOSC_MEMCPYED); - /* "numcodecs/blosc.pyx":206 + /* "numcodecs/blosc.pyx":207 * memcpyed = flags & BLOSC_MEMCPYED * * return typesize, shuffle, memcpyed # <<<<<<<<<<<<<< @@ -2778,11 +2812,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_memcpyed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_memcpyed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -2797,7 +2831,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO __pyx_t_4 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":171 + /* "numcodecs/blosc.pyx":172 * * * def cbuffer_metainfo(source): # <<<<<<<<<<<<<< @@ -2820,7 +2854,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_16cbuffer_metainfo(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":209 +/* "numcodecs/blosc.pyx":210 * * * def err_bad_cname(cname): # <<<<<<<<<<<<<< @@ -2854,14 +2888,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("err_bad_cname", 0); - /* "numcodecs/blosc.pyx":210 + /* "numcodecs/blosc.pyx":211 * * def err_bad_cname(cname): * raise ValueError('bad compressor or compressor not supported: %r; expected one of ' # <<<<<<<<<<<<<< * '%s' % (cname, list_compressors())) * */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -2870,14 +2904,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje __Pyx_GIVEREF(__pyx_kp_u_bad_compressor_or_compressor_not); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_bad_compressor_or_compressor_not); - /* "numcodecs/blosc.pyx":211 + /* "numcodecs/blosc.pyx":212 * def err_bad_cname(cname): * raise ValueError('bad compressor or compressor not supported: %r; expected one of ' * '%s' % (cname, list_compressors())) # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_cname), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_cname), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); @@ -2888,7 +2922,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje __pyx_t_2 += 18; __Pyx_GIVEREF(__pyx_kp_u_expected_one_of); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_expected_one_of); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_list_compressors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_list_compressors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -2902,10 +2936,10 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -2914,24 +2948,24 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5); __pyx_t_5 = 0; - /* "numcodecs/blosc.pyx":210 + /* "numcodecs/blosc.pyx":211 * * def err_bad_cname(cname): * raise ValueError('bad compressor or compressor not supported: %r; expected one of ' # <<<<<<<<<<<<<< * '%s' % (cname, list_compressors())) * */ - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 210, __pyx_L1_error) + __PYX_ERR(0, 211, __pyx_L1_error) - /* "numcodecs/blosc.pyx":209 + /* "numcodecs/blosc.pyx":210 * * * def err_bad_cname(cname): # <<<<<<<<<<<<<< @@ -2952,7 +2986,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_18err_bad_cname(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":214 +/* "numcodecs/blosc.pyx":215 * * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, # <<<<<<<<<<<<<< @@ -3002,13 +3036,13 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_21compress(PyObject *__pyx_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cname)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, 1); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, 1); __PYX_ERR(0, 215, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clevel)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, 2); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, 2); __PYX_ERR(0, 215, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -3024,7 +3058,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_21compress(PyObject *__pyx_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress") < 0)) __PYX_ERR(0, 215, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3040,22 +3074,22 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_21compress(PyObject *__pyx_self, PyO } } __pyx_v_source = values[0]; - __pyx_v_cname = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_cname) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) - __pyx_v_clevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_clevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_cname = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_cname) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_clevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_clevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) if (values[3]) { - __pyx_v_shuffle = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_shuffle == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) + __pyx_v_shuffle = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_shuffle == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) } else { __pyx_v_shuffle = __pyx_k__2; } if (values[4]) { - __pyx_v_blocksize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_blocksize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) + __pyx_v_blocksize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_blocksize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) } else { __pyx_v_blocksize = __pyx_k__3; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compress", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3099,26 +3133,26 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ PyObject *__pyx_t_17 = NULL; __Pyx_RefNannySetupContext("compress", 0); - /* "numcodecs/blosc.pyx":251 + /* "numcodecs/blosc.pyx":252 * * # check valid cname early * cname_str = cname.decode('ascii') # <<<<<<<<<<<<<< * if cname_str not in list_compressors(): * err_bad_cname(cname_str) */ - __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_cname, 0, strlen(__pyx_v_cname), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_cname, 0, strlen(__pyx_v_cname), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cname_str = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":252 + /* "numcodecs/blosc.pyx":253 * # check valid cname early * cname_str = cname.decode('ascii') * if cname_str not in list_compressors(): # <<<<<<<<<<<<<< * err_bad_cname(cname_str) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_list_compressors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_list_compressors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -3132,22 +3166,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_cname_str, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_cname_str, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":253 + /* "numcodecs/blosc.pyx":254 * cname_str = cname.decode('ascii') * if cname_str not in list_compressors(): * err_bad_cname(cname_str) # <<<<<<<<<<<<<< * * # setup source buffer */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_err_bad_cname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_err_bad_cname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -3161,12 +3195,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cname_str) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cname_str); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":252 + /* "numcodecs/blosc.pyx":253 * # check valid cname early * cname_str = cname.decode('ascii') * if cname_str not in list_compressors(): # <<<<<<<<<<<<<< @@ -3175,16 +3209,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ } - /* "numcodecs/blosc.pyx":256 + /* "numcodecs/blosc.pyx":257 * * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< * source_ptr = source_buffer.ptr * nbytes = source_buffer.nbytes */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -3192,13 +3226,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":257 + /* "numcodecs/blosc.pyx":258 * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< @@ -3208,7 +3242,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_6 = __pyx_v_source_buffer->ptr; __pyx_v_source_ptr = __pyx_t_6; - /* "numcodecs/blosc.pyx":258 + /* "numcodecs/blosc.pyx":259 * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr * nbytes = source_buffer.nbytes # <<<<<<<<<<<<<< @@ -3218,7 +3252,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_7 = __pyx_v_source_buffer->nbytes; __pyx_v_nbytes = __pyx_t_7; - /* "numcodecs/blosc.pyx":259 + /* "numcodecs/blosc.pyx":260 * source_ptr = source_buffer.ptr * nbytes = source_buffer.nbytes * itemsize = source_buffer.itemsize # <<<<<<<<<<<<<< @@ -3228,25 +3262,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_7 = __pyx_v_source_buffer->itemsize; __pyx_v_itemsize = __pyx_t_7; - /* "numcodecs/blosc.pyx":262 + /* "numcodecs/blosc.pyx":263 * * # determine shuffle * if shuffle == AUTOSHUFFLE: # <<<<<<<<<<<<<< * if itemsize == 1: * shuffle = BITSHUFFLE */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_shuffle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_shuffle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":263 + /* "numcodecs/blosc.pyx":264 * # determine shuffle * if shuffle == AUTOSHUFFLE: * if itemsize == 1: # <<<<<<<<<<<<<< @@ -3256,20 +3290,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_5 = ((__pyx_v_itemsize == 1) != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":264 + /* "numcodecs/blosc.pyx":265 * if shuffle == AUTOSHUFFLE: * if itemsize == 1: * shuffle = BITSHUFFLE # <<<<<<<<<<<<<< * else: * shuffle = SHUFFLE */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_shuffle = __pyx_t_8; - /* "numcodecs/blosc.pyx":263 + /* "numcodecs/blosc.pyx":264 * # determine shuffle * if shuffle == AUTOSHUFFLE: * if itemsize == 1: # <<<<<<<<<<<<<< @@ -3279,7 +3313,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ goto __pyx_L5; } - /* "numcodecs/blosc.pyx":266 + /* "numcodecs/blosc.pyx":267 * shuffle = BITSHUFFLE * else: * shuffle = SHUFFLE # <<<<<<<<<<<<<< @@ -3287,15 +3321,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ * raise ValueError('invalid shuffle argument; expected -1, 0, 1 or 2, found %r' % */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_shuffle = __pyx_t_8; } __pyx_L5:; - /* "numcodecs/blosc.pyx":262 + /* "numcodecs/blosc.pyx":263 * * # determine shuffle * if shuffle == AUTOSHUFFLE: # <<<<<<<<<<<<<< @@ -3305,7 +3339,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ goto __pyx_L4; } - /* "numcodecs/blosc.pyx":267 + /* "numcodecs/blosc.pyx":268 * else: * shuffle = SHUFFLE * elif shuffle not in [NOSHUFFLE, SHUFFLE, BITSHUFFLE]: # <<<<<<<<<<<<<< @@ -3313,76 +3347,76 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ * shuffle) */ __pyx_t_8 = __pyx_v_shuffle; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BITSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; __pyx_t_4 = (__pyx_t_5 != 0); if (unlikely(__pyx_t_4)) { - /* "numcodecs/blosc.pyx":269 + /* "numcodecs/blosc.pyx":270 * elif shuffle not in [NOSHUFFLE, SHUFFLE, BITSHUFFLE]: * raise ValueError('invalid shuffle argument; expected -1, 0, 1 or 2, found %r' % * shuffle) # <<<<<<<<<<<<<< * * try: */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_shuffle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_shuffle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "numcodecs/blosc.pyx":268 + /* "numcodecs/blosc.pyx":269 * shuffle = SHUFFLE * elif shuffle not in [NOSHUFFLE, SHUFFLE, BITSHUFFLE]: * raise ValueError('invalid shuffle argument; expected -1, 0, 1 or 2, found %r' % # <<<<<<<<<<<<<< * shuffle) * */ - __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_invalid_shuffle_argument_expecte, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_invalid_shuffle_argument_expecte, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 268, __pyx_L1_error) + __PYX_ERR(0, 269, __pyx_L1_error) - /* "numcodecs/blosc.pyx":267 + /* "numcodecs/blosc.pyx":268 * else: * shuffle = SHUFFLE * elif shuffle not in [NOSHUFFLE, SHUFFLE, BITSHUFFLE]: # <<<<<<<<<<<<<< @@ -3392,7 +3426,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_L4:; - /* "numcodecs/blosc.pyx":271 + /* "numcodecs/blosc.pyx":272 * shuffle) * * try: # <<<<<<<<<<<<<< @@ -3401,19 +3435,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ /*try:*/ { - /* "numcodecs/blosc.pyx":274 + /* "numcodecs/blosc.pyx":275 * * # setup destination * dest = PyBytes_FromStringAndSize(NULL, nbytes + BLOSC_MAX_OVERHEAD) # <<<<<<<<<<<<<< * dest_ptr = PyBytes_AS_STRING(dest) * */ - __pyx_t_1 = PyBytes_FromStringAndSize(NULL, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L10_error) + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dest = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":275 + /* "numcodecs/blosc.pyx":276 * # setup destination * dest = PyBytes_FromStringAndSize(NULL, nbytes + BLOSC_MAX_OVERHEAD) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -3422,14 +3456,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":278 + /* "numcodecs/blosc.pyx":279 * * # perform compression * if _get_use_threads(): # <<<<<<<<<<<<<< * # allow blosc to use threads internally * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -3443,14 +3477,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L10_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 278, __pyx_L10_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 279, __pyx_L10_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":284 + /* "numcodecs/blosc.pyx":285 * # to ensure no-one else can modify the global context while we're setting it * # up and using it. * with mutex: # <<<<<<<<<<<<<< @@ -3458,11 +3492,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ * # set compressor */ /*with:*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L10_error) + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 285, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L13_error) + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -3476,7 +3510,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L13_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3491,7 +3525,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { - /* "numcodecs/blosc.pyx":287 + /* "numcodecs/blosc.pyx":288 * * # set compressor * compressor_set = blosc_set_compressor(cname) # <<<<<<<<<<<<<< @@ -3500,7 +3534,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ __pyx_v_compressor_set = blosc_set_compressor(__pyx_v_cname); - /* "numcodecs/blosc.pyx":288 + /* "numcodecs/blosc.pyx":289 * # set compressor * compressor_set = blosc_set_compressor(cname) * if compressor_set < 0: # <<<<<<<<<<<<<< @@ -3510,14 +3544,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_4 = ((__pyx_v_compressor_set < 0) != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":291 + /* "numcodecs/blosc.pyx":292 * # shouldn't happen if we checked against list of compressors * # already, but just in case * err_bad_cname(cname_str) # <<<<<<<<<<<<<< * * # set blocksize */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_err_bad_cname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L17_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_err_bad_cname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -3531,12 +3565,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cname_str) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cname_str); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L17_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":288 + /* "numcodecs/blosc.pyx":289 * # set compressor * compressor_set = blosc_set_compressor(cname) * if compressor_set < 0: # <<<<<<<<<<<<<< @@ -3545,7 +3579,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ } - /* "numcodecs/blosc.pyx":294 + /* "numcodecs/blosc.pyx":295 * * # set blocksize * blosc_set_blocksize(blocksize) # <<<<<<<<<<<<<< @@ -3554,7 +3588,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ blosc_set_blocksize(__pyx_v_blocksize); - /* "numcodecs/blosc.pyx":297 + /* "numcodecs/blosc.pyx":298 * * # perform compression * with nogil: # <<<<<<<<<<<<<< @@ -3569,7 +3603,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ #endif /*try:*/ { - /* "numcodecs/blosc.pyx":298 + /* "numcodecs/blosc.pyx":299 * # perform compression * with nogil: * cbytes = blosc_compress(clevel, shuffle, itemsize, nbytes, source_ptr, # <<<<<<<<<<<<<< @@ -3579,7 +3613,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_v_cbytes = blosc_compress(__pyx_v_clevel, __pyx_v_shuffle, __pyx_v_itemsize, __pyx_v_nbytes, __pyx_v_source_ptr, __pyx_v_dest_ptr, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD)); } - /* "numcodecs/blosc.pyx":297 + /* "numcodecs/blosc.pyx":298 * * # perform compression * with nogil: # <<<<<<<<<<<<<< @@ -3598,7 +3632,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ } } - /* "numcodecs/blosc.pyx":284 + /* "numcodecs/blosc.pyx":285 * # to ensure no-one else can modify the global context while we're setting it * # up and using it. * with mutex: # <<<<<<<<<<<<<< @@ -3617,20 +3651,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("numcodecs.blosc.compress", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 284, __pyx_L19_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 285, __pyx_L19_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 284, __pyx_L19_except_error) + __pyx_t_10 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 285, __pyx_L19_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 284, __pyx_L19_except_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 285, __pyx_L19_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_4 < 0) __PYX_ERR(0, 284, __pyx_L19_except_error) + if (__pyx_t_4 < 0) __PYX_ERR(0, 285, __pyx_L19_except_error) __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_1); @@ -3638,7 +3672,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - __PYX_ERR(0, 284, __pyx_L19_except_error) + __PYX_ERR(0, 285, __pyx_L19_except_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3664,7 +3698,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ if (__pyx_t_9) { __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__4, NULL); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 284, __pyx_L10_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 285, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } @@ -3679,7 +3713,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_L30:; } - /* "numcodecs/blosc.pyx":278 + /* "numcodecs/blosc.pyx":279 * * # perform compression * if _get_use_threads(): # <<<<<<<<<<<<<< @@ -3689,7 +3723,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ goto __pyx_L12; } - /* "numcodecs/blosc.pyx":302 + /* "numcodecs/blosc.pyx":303 * * else: * with nogil: # <<<<<<<<<<<<<< @@ -3705,7 +3739,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ #endif /*try:*/ { - /* "numcodecs/blosc.pyx":303 + /* "numcodecs/blosc.pyx":304 * else: * with nogil: * cbytes = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes, source_ptr, # <<<<<<<<<<<<<< @@ -3715,7 +3749,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_v_cbytes = blosc_compress_ctx(__pyx_v_clevel, __pyx_v_shuffle, __pyx_v_itemsize, __pyx_v_nbytes, __pyx_v_source_ptr, __pyx_v_dest_ptr, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD), __pyx_v_cname, __pyx_v_blocksize, 1); } - /* "numcodecs/blosc.pyx":302 + /* "numcodecs/blosc.pyx":303 * * else: * with nogil: # <<<<<<<<<<<<<< @@ -3737,7 +3771,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_L12:; } - /* "numcodecs/blosc.pyx":310 + /* "numcodecs/blosc.pyx":311 * * # release buffers * source_buffer.release() # <<<<<<<<<<<<<< @@ -3746,7 +3780,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ /*finally:*/ { /*normal exit:*/{ - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L11; @@ -3770,7 +3804,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __Pyx_XGOTREF(__pyx_t_17); __pyx_t_8 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L35_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -3803,7 +3837,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_L11:; } - /* "numcodecs/blosc.pyx":313 + /* "numcodecs/blosc.pyx":314 * * # check compression was successful * if cbytes <= 0: # <<<<<<<<<<<<<< @@ -3813,26 +3847,26 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_t_5 = ((__pyx_v_cbytes <= 0) != 0); if (unlikely(__pyx_t_5)) { - /* "numcodecs/blosc.pyx":314 + /* "numcodecs/blosc.pyx":315 * # check compression was successful * if cbytes <= 0: * raise RuntimeError('error during blosc compression: %d' % cbytes) # <<<<<<<<<<<<<< * * # resize after compression */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_error_during_blosc_compression_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_error_during_blosc_compression_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 314, __pyx_L1_error) + __PYX_ERR(0, 315, __pyx_L1_error) - /* "numcodecs/blosc.pyx":313 + /* "numcodecs/blosc.pyx":314 * * # check compression was successful * if cbytes <= 0: # <<<<<<<<<<<<<< @@ -3841,7 +3875,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ } - /* "numcodecs/blosc.pyx":317 + /* "numcodecs/blosc.pyx":318 * * # resize after compression * dest = dest[:cbytes] # <<<<<<<<<<<<<< @@ -3850,14 +3884,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ */ if (unlikely(__pyx_v_dest == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 317, __pyx_L1_error) + __PYX_ERR(0, 318, __pyx_L1_error) } - __pyx_t_3 = PySequence_GetSlice(__pyx_v_dest, 0, __pyx_v_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_3 = PySequence_GetSlice(__pyx_v_dest, 0, __pyx_v_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_dest, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":319 + /* "numcodecs/blosc.pyx":320 * dest = dest[:cbytes] * * return dest # <<<<<<<<<<<<<< @@ -3869,7 +3903,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_dest; goto __pyx_L0; - /* "numcodecs/blosc.pyx":214 + /* "numcodecs/blosc.pyx":215 * * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, # <<<<<<<<<<<<<< @@ -3894,7 +3928,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_20compress(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "numcodecs/blosc.pyx":322 +/* "numcodecs/blosc.pyx":323 * * * def decompress(source, dest=None): # <<<<<<<<<<<<<< @@ -3940,7 +3974,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_23decompress(PyObject *__pyx_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress") < 0)) __PYX_ERR(0, 322, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress") < 0)) __PYX_ERR(0, 323, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3956,7 +3990,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_23decompress(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decompress", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4003,7 +4037,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __Pyx_RefNannySetupContext("decompress", 0); __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":344 + /* "numcodecs/blosc.pyx":345 * char *dest_ptr * Buffer source_buffer * Buffer dest_buffer = None # <<<<<<<<<<<<<< @@ -4013,16 +4047,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __Pyx_INCREF(Py_None); __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); - /* "numcodecs/blosc.pyx":348 + /* "numcodecs/blosc.pyx":349 * * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< * source_ptr = source_buffer.ptr * */ - __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -4030,13 +4064,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":349 + /* "numcodecs/blosc.pyx":350 * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< @@ -4046,7 +4080,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_3 = __pyx_v_source_buffer->ptr; __pyx_v_source_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":352 + /* "numcodecs/blosc.pyx":353 * * # determine buffer size * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) # <<<<<<<<<<<<<< @@ -4055,7 +4089,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ blosc_cbuffer_sizes(__pyx_v_source_ptr, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize)); - /* "numcodecs/blosc.pyx":355 + /* "numcodecs/blosc.pyx":356 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -4066,19 +4100,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":357 + /* "numcodecs/blosc.pyx":358 * if dest is None: * # allocate memory * dest = PyBytes_FromStringAndSize(NULL, nbytes) # <<<<<<<<<<<<<< * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nbytes */ - __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":358 + /* "numcodecs/blosc.pyx":359 * # allocate memory * dest = PyBytes_FromStringAndSize(NULL, nbytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -4087,7 +4121,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":359 + /* "numcodecs/blosc.pyx":360 * dest = PyBytes_FromStringAndSize(NULL, nbytes) * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nbytes # <<<<<<<<<<<<<< @@ -4096,7 +4130,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ __pyx_v_dest_nbytes = __pyx_v_nbytes; - /* "numcodecs/blosc.pyx":355 + /* "numcodecs/blosc.pyx":356 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -4106,7 +4140,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "numcodecs/blosc.pyx":361 + /* "numcodecs/blosc.pyx":362 * dest_nbytes = nbytes * else: * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< @@ -4114,7 +4148,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject * dest_ptr = dest_buffer.ptr */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -4128,22 +4162,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dest); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":362 + /* "numcodecs/blosc.pyx":363 * else: * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) # <<<<<<<<<<<<<< * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes */ - __pyx_t_1 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -4151,13 +4185,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1)); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":363 + /* "numcodecs/blosc.pyx":364 * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< @@ -4167,7 +4201,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_3 = __pyx_v_dest_buffer->ptr; __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":364 + /* "numcodecs/blosc.pyx":365 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< @@ -4179,7 +4213,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject } __pyx_L3:; - /* "numcodecs/blosc.pyx":366 + /* "numcodecs/blosc.pyx":367 * dest_nbytes = dest_buffer.nbytes * * try: # <<<<<<<<<<<<<< @@ -4188,7 +4222,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ /*try:*/ { - /* "numcodecs/blosc.pyx":369 + /* "numcodecs/blosc.pyx":370 * * # guard condition * if dest_nbytes < nbytes: # <<<<<<<<<<<<<< @@ -4198,14 +4232,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_5 = ((__pyx_v_dest_nbytes < __pyx_v_nbytes) != 0); if (unlikely(__pyx_t_5)) { - /* "numcodecs/blosc.pyx":370 + /* "numcodecs/blosc.pyx":371 * # guard condition * if dest_nbytes < nbytes: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nbytes, dest_nbytes)) * */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L5_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = 127; @@ -4214,14 +4248,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_destination_buffer_too_small_exp); - /* "numcodecs/blosc.pyx":371 + /* "numcodecs/blosc.pyx":372 * if dest_nbytes < nbytes: * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nbytes, dest_nbytes)) # <<<<<<<<<<<<<< * * # perform decompression */ - __pyx_t_2 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -4231,31 +4265,31 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_8 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got); - __pyx_t_2 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":370 + /* "numcodecs/blosc.pyx":371 * # guard condition * if dest_nbytes < nbytes: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nbytes, dest_nbytes)) * */ - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 370, __pyx_L5_error) + __PYX_ERR(0, 371, __pyx_L5_error) - /* "numcodecs/blosc.pyx":369 + /* "numcodecs/blosc.pyx":370 * * # guard condition * if dest_nbytes < nbytes: # <<<<<<<<<<<<<< @@ -4264,14 +4298,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ } - /* "numcodecs/blosc.pyx":374 + /* "numcodecs/blosc.pyx":375 * * # perform decompression * if _get_use_threads(): # <<<<<<<<<<<<<< * # allow blosc to use threads internally * with nogil: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L5_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -4285,14 +4319,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L5_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 374, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 375, __pyx_L5_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":376 + /* "numcodecs/blosc.pyx":377 * if _get_use_threads(): * # allow blosc to use threads internally * with nogil: # <<<<<<<<<<<<<< @@ -4307,7 +4341,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "numcodecs/blosc.pyx":377 + /* "numcodecs/blosc.pyx":378 * # allow blosc to use threads internally * with nogil: * ret = blosc_decompress(source_ptr, dest_ptr, nbytes) # <<<<<<<<<<<<<< @@ -4317,7 +4351,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_v_ret = blosc_decompress(__pyx_v_source_ptr, __pyx_v_dest_ptr, __pyx_v_nbytes); } - /* "numcodecs/blosc.pyx":376 + /* "numcodecs/blosc.pyx":377 * if _get_use_threads(): * # allow blosc to use threads internally * with nogil: # <<<<<<<<<<<<<< @@ -4336,7 +4370,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject } } - /* "numcodecs/blosc.pyx":374 + /* "numcodecs/blosc.pyx":375 * * # perform decompression * if _get_use_threads(): # <<<<<<<<<<<<<< @@ -4346,7 +4380,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject goto __pyx_L8; } - /* "numcodecs/blosc.pyx":379 + /* "numcodecs/blosc.pyx":380 * ret = blosc_decompress(source_ptr, dest_ptr, nbytes) * else: * with nogil: # <<<<<<<<<<<<<< @@ -4362,7 +4396,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "numcodecs/blosc.pyx":380 + /* "numcodecs/blosc.pyx":381 * else: * with nogil: * ret = blosc_decompress_ctx(source_ptr, dest_ptr, nbytes, 1) # <<<<<<<<<<<<<< @@ -4372,7 +4406,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_v_ret = blosc_decompress_ctx(__pyx_v_source_ptr, __pyx_v_dest_ptr, __pyx_v_nbytes, 1); } - /* "numcodecs/blosc.pyx":379 + /* "numcodecs/blosc.pyx":380 * ret = blosc_decompress(source_ptr, dest_ptr, nbytes) * else: * with nogil: # <<<<<<<<<<<<<< @@ -4394,7 +4428,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_L8:; } - /* "numcodecs/blosc.pyx":385 + /* "numcodecs/blosc.pyx":386 * * # release buffers * source_buffer.release() # <<<<<<<<<<<<<< @@ -4403,11 +4437,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ /*finally:*/ { /*normal exit:*/{ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":386 + /* "numcodecs/blosc.pyx":387 * # release buffers * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -4418,18 +4452,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":387 + /* "numcodecs/blosc.pyx":388 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * * # handle errors */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":386 + /* "numcodecs/blosc.pyx":387 * # release buffers * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -4458,18 +4492,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { - /* "numcodecs/blosc.pyx":385 + /* "numcodecs/blosc.pyx":386 * * # release buffers * source_buffer.release() # <<<<<<<<<<<<<< * if dest_buffer is not None: * dest_buffer.release() */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L17_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":386 + /* "numcodecs/blosc.pyx":387 * # release buffers * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -4480,18 +4514,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":387 + /* "numcodecs/blosc.pyx":388 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * * # handle errors */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L17_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":386 + /* "numcodecs/blosc.pyx":387 * # release buffers * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -4529,7 +4563,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_L6:; } - /* "numcodecs/blosc.pyx":390 + /* "numcodecs/blosc.pyx":391 * * # handle errors * if ret <= 0: # <<<<<<<<<<<<<< @@ -4539,26 +4573,26 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_t_5 = ((__pyx_v_ret <= 0) != 0); if (unlikely(__pyx_t_5)) { - /* "numcodecs/blosc.pyx":391 + /* "numcodecs/blosc.pyx":392 * # handle errors * if ret <= 0: * raise RuntimeError('error during blosc decompression: %d' % ret) # <<<<<<<<<<<<<< * * return dest */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_error_during_blosc_decompression, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_error_during_blosc_decompression, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) - /* "numcodecs/blosc.pyx":390 + /* "numcodecs/blosc.pyx":391 * * # handle errors * if ret <= 0: # <<<<<<<<<<<<<< @@ -4567,7 +4601,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject */ } - /* "numcodecs/blosc.pyx":393 + /* "numcodecs/blosc.pyx":394 * raise RuntimeError('error during blosc decompression: %d' % ret) * * return dest # <<<<<<<<<<<<<< @@ -4579,7 +4613,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_dest; goto __pyx_L0; - /* "numcodecs/blosc.pyx":322 + /* "numcodecs/blosc.pyx":323 * * * def decompress(source, dest=None): # <<<<<<<<<<<<<< @@ -4604,55 +4638,710 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject return __pyx_r; } -/* "numcodecs/blosc.pyx":401 +/* "numcodecs/blosc.pyx":397 * * - * def _get_use_threads(): # <<<<<<<<<<<<<< - * global use_threads - * proc = multiprocessing.current_process() + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * """**Experimental** + * Decompress data of only a part of a buffer. */ /* Python wrapper */ -static PyObject *__pyx_pw_9numcodecs_5blosc_25_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_9numcodecs_5blosc_24_get_use_threads[] = "_get_use_threads()"; -static PyMethodDef __pyx_mdef_9numcodecs_5blosc_25_get_use_threads = {"_get_use_threads", (PyCFunction)__pyx_pw_9numcodecs_5blosc_25_get_use_threads, METH_NOARGS, __pyx_doc_9numcodecs_5blosc_24_get_use_threads}; -static PyObject *__pyx_pw_9numcodecs_5blosc_25_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_9numcodecs_5blosc_24decompress_partial[] = "decompress_partial(source, start, nitems, dest=None)\n**Experimental**\n Decompress data of only a part of a buffer.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n start: int,\n Offset in item where we want to start decoding\n nitems: int\n Number of items we want to decode\n dest : array-like, optional\n Object to decompress into.\n\n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +static PyMethodDef __pyx_mdef_9numcodecs_5blosc_25decompress_partial = {"decompress_partial", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9numcodecs_5blosc_25decompress_partial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9numcodecs_5blosc_24decompress_partial}; +static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_v_start = 0; + PyObject *__pyx_v_nitems = 0; + PyObject *__pyx_v_dest = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_use_threads (wrapper)", 0); - __pyx_r = __pyx_pf_9numcodecs_5blosc_24_get_use_threads(__pyx_self); + __Pyx_RefNannySetupContext("decompress_partial (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_dest,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 4, 1); __PYX_ERR(0, 397, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nitems)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 4, 2); __PYX_ERR(0, 397, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress_partial") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_source = values[0]; + __pyx_v_start = values[1]; + __pyx_v_nitems = values[2]; + __pyx_v_dest = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("numcodecs.blosc.decompress_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9numcodecs_5blosc_24decompress_partial(__pyx_self, __pyx_v_source, __pyx_v_start, __pyx_v_nitems, __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_v_proc = NULL; - PyObject *__pyx_v__use_threads = NULL; +static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_dest) { + int __pyx_v_ret; + int __pyx_v_encoding_size; + int __pyx_v_nitems_bytes; + CYTHON_UNUSED int __pyx_v_start_bytes; + char *__pyx_v_source_ptr; + char *__pyx_v_dest_ptr; + struct __pyx_obj_9numcodecs_10compat_ext_Buffer *__pyx_v_source_buffer = 0; + struct __pyx_obj_9numcodecs_10compat_ext_Buffer *__pyx_v_dest_buffer = 0; + size_t __pyx_v_dest_nbytes; + PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + char *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("_get_use_threads", 0); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + size_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_UCS4 __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __Pyx_RefNannySetupContext("decompress_partial", 0); + __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":403 - * def _get_use_threads(): - * global use_threads - * proc = multiprocessing.current_process() # <<<<<<<<<<<<<< + /* "numcodecs/blosc.pyx":428 + * char *dest_ptr + * Buffer source_buffer + * Buffer dest_buffer = None # <<<<<<<<<<<<<< * - * # check if locks are available, and if not no threads + * # setup source buffer */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __Pyx_INCREF(Py_None); + __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); + + /* "numcodecs/blosc.pyx":431 + * + * # setup source buffer + * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< + * source_ptr = source_buffer.ptr + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":432 + * # setup source buffer + * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< + * + * # get encoding size from source buffer header + */ + __pyx_t_3 = __pyx_v_source_buffer->ptr; + __pyx_v_source_ptr = __pyx_t_3; + + /* "numcodecs/blosc.pyx":435 + * + * # get encoding size from source buffer header + * encoding_size = source[3] # <<<<<<<<<<<<<< + * + * # convert varibles to handle type and encoding sizes + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_encoding_size = __pyx_t_4; + + /* "numcodecs/blosc.pyx":438 + * + * # convert varibles to handle type and encoding sizes + * nitems_bytes = nitems * encoding_size # <<<<<<<<<<<<<< + * start_bytes = (start * encoding_size) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Multiply(__pyx_v_nitems, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nitems_bytes = __pyx_t_4; + + /* "numcodecs/blosc.pyx":439 + * # convert varibles to handle type and encoding sizes + * nitems_bytes = nitems * encoding_size + * start_bytes = (start * encoding_size) # <<<<<<<<<<<<<< + * + * # setup destination buffer + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_start_bytes = __pyx_t_4; + + /* "numcodecs/blosc.pyx":442 + * + * # setup destination buffer + * if dest is None: # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) + * dest_ptr = PyBytes_AS_STRING(dest) + */ + __pyx_t_5 = (__pyx_v_dest == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "numcodecs/blosc.pyx":443 + * # setup destination buffer + * if dest is None: + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) # <<<<<<<<<<<<<< + * dest_ptr = PyBytes_AS_STRING(dest) + * dest_nbytes = nitems_bytes + */ + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":444 + * if dest is None: + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) + * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< + * dest_nbytes = nitems_bytes + * else: + */ + __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); + + /* "numcodecs/blosc.pyx":445 + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) + * dest_ptr = PyBytes_AS_STRING(dest) + * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< + * else: + * arr = ensure_contiguous_ndarray(dest) + */ + __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; + + /* "numcodecs/blosc.pyx":442 + * + * # setup destination buffer + * if dest is None: # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) + * dest_ptr = PyBytes_AS_STRING(dest) + */ + goto __pyx_L3; + } + + /* "numcodecs/blosc.pyx":447 + * dest_nbytes = nitems_bytes + * else: + * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< + * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) + * dest_ptr = dest_buffer.ptr + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dest); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":448 + * else: + * arr = ensure_contiguous_ndarray(dest) + * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) # <<<<<<<<<<<<<< + * dest_ptr = dest_buffer.ptr + * dest_nbytes = dest_buffer.nbytes + */ + __pyx_t_1 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":449 + * arr = ensure_contiguous_ndarray(dest) + * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) + * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< + * dest_nbytes = dest_buffer.nbytes + * + */ + __pyx_t_3 = __pyx_v_dest_buffer->ptr; + __pyx_v_dest_ptr = __pyx_t_3; + + /* "numcodecs/blosc.pyx":450 + * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) + * dest_ptr = dest_buffer.ptr + * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< + * + * # try decompression + */ + __pyx_t_8 = __pyx_v_dest_buffer->nbytes; + __pyx_v_dest_nbytes = __pyx_t_8; + } + __pyx_L3:; + + /* "numcodecs/blosc.pyx":453 + * + * # try decompression + * try: # <<<<<<<<<<<<<< + * if dest_nbytes < nitems_bytes: + * raise ValueError('destination buffer too small; expected at least %s, ' + */ + /*try:*/ { + + /* "numcodecs/blosc.pyx":454 + * # try decompression + * try: + * if dest_nbytes < nitems_bytes: # <<<<<<<<<<<<<< + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems_bytes, dest_nbytes)) + */ + __pyx_t_6 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_bytes) != 0); + if (unlikely(__pyx_t_6)) { + + /* "numcodecs/blosc.pyx":455 + * try: + * if dest_nbytes < nitems_bytes: + * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< + * 'got %s' % (nitems_bytes, dest_nbytes)) + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + */ + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = 0; + __pyx_t_10 = 127; + __Pyx_INCREF(__pyx_kp_u_destination_buffer_too_small_exp); + __pyx_t_9 += 48; + __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_destination_buffer_too_small_exp); + + /* "numcodecs/blosc.pyx":456 + * if dest_nbytes < nitems_bytes: + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems_bytes, dest_nbytes)) # <<<<<<<<<<<<<< + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + * + */ + __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_bytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_kp_u_got); + __pyx_t_9 += 6; + __Pyx_GIVEREF(__pyx_kp_u_got); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got); + __pyx_t_2 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); + __pyx_t_2 = 0; + + /* "numcodecs/blosc.pyx":455 + * try: + * if dest_nbytes < nitems_bytes: + * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< + * 'got %s' % (nitems_bytes, dest_nbytes)) + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + */ + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 455, __pyx_L5_error) + + /* "numcodecs/blosc.pyx":454 + * # try decompression + * try: + * if dest_nbytes < nitems_bytes: # <<<<<<<<<<<<<< + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems_bytes, dest_nbytes)) + */ + } + + /* "numcodecs/blosc.pyx":457 + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems_bytes, dest_nbytes)) + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) # <<<<<<<<<<<<<< + * + * finally: + */ + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L5_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_nitems); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L5_error) + __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_t_4, __pyx_t_11, __pyx_v_dest_ptr); + } + + /* "numcodecs/blosc.pyx":460 + * + * finally: + * source_buffer.release() # <<<<<<<<<<<<<< + * if dest_buffer is not None: + * dest_buffer.release() + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":461 + * finally: + * source_buffer.release() + * if dest_buffer is not None: # <<<<<<<<<<<<<< + * dest_buffer.release() + * + */ + __pyx_t_6 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "numcodecs/blosc.pyx":462 + * source_buffer.release() + * if dest_buffer is not None: + * dest_buffer.release() # <<<<<<<<<<<<<< + * + * # ret refers to the number of bytes returned from blosc_getitem. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":461 + * finally: + * source_buffer.release() + * if dest_buffer is not None: # <<<<<<<<<<<<<< + * dest_buffer.release() + * + */ + } + goto __pyx_L6; + } + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_11 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + + /* "numcodecs/blosc.pyx":460 + * + * finally: + * source_buffer.release() # <<<<<<<<<<<<<< + * if dest_buffer is not None: + * dest_buffer.release() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":461 + * finally: + * source_buffer.release() + * if dest_buffer is not None: # <<<<<<<<<<<<<< + * dest_buffer.release() + * + */ + __pyx_t_5 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "numcodecs/blosc.pyx":462 + * source_buffer.release() + * if dest_buffer is not None: + * dest_buffer.release() # <<<<<<<<<<<<<< + * + * # ret refers to the number of bytes returned from blosc_getitem. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":461 + * finally: + * source_buffer.release() + * if dest_buffer is not None: # <<<<<<<<<<<<<< + * dest_buffer.release() + * + */ + } + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + __pyx_L10_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + goto __pyx_L1_error; + } + __pyx_L6:; + } + + /* "numcodecs/blosc.pyx":465 + * + * # ret refers to the number of bytes returned from blosc_getitem. + * if ret <= 0: # <<<<<<<<<<<<<< + * raise RuntimeError('error during blosc partial decompression: %d', ret) + * + */ + __pyx_t_6 = ((__pyx_v_ret <= 0) != 0); + if (unlikely(__pyx_t_6)) { + + /* "numcodecs/blosc.pyx":466 + * # ret refers to the number of bytes returned from blosc_getitem. + * if ret <= 0: + * raise RuntimeError('error during blosc partial decompression: %d', ret) # <<<<<<<<<<<<<< + * + * return dest + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_u_error_during_blosc_partial_decom); + __Pyx_GIVEREF(__pyx_kp_u_error_during_blosc_partial_decom); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_error_during_blosc_partial_decom); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 466, __pyx_L1_error) + + /* "numcodecs/blosc.pyx":465 + * + * # ret refers to the number of bytes returned from blosc_getitem. + * if ret <= 0: # <<<<<<<<<<<<<< + * raise RuntimeError('error during blosc partial decompression: %d', ret) + * + */ + } + + /* "numcodecs/blosc.pyx":468 + * raise RuntimeError('error during blosc partial decompression: %d', ret) + * + * return dest # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dest); + __pyx_r = __pyx_v_dest; + goto __pyx_L0; + + /* "numcodecs/blosc.pyx":397 + * + * + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * """**Experimental** + * Decompress data of only a part of a buffer. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("numcodecs.blosc.decompress_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_source_buffer); + __Pyx_XDECREF((PyObject *)__pyx_v_dest_buffer); + __Pyx_XDECREF(__pyx_v_arr); + __Pyx_XDECREF(__pyx_v_dest); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numcodecs/blosc.pyx":476 + * + * + * def _get_use_threads(): # <<<<<<<<<<<<<< + * global use_threads + * proc = multiprocessing.current_process() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9numcodecs_5blosc_27_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_9numcodecs_5blosc_26_get_use_threads[] = "_get_use_threads()"; +static PyMethodDef __pyx_mdef_9numcodecs_5blosc_27_get_use_threads = {"_get_use_threads", (PyCFunction)__pyx_pw_9numcodecs_5blosc_27_get_use_threads, METH_NOARGS, __pyx_doc_9numcodecs_5blosc_26_get_use_threads}; +static PyObject *__pyx_pw_9numcodecs_5blosc_27_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_use_threads (wrapper)", 0); + __pyx_r = __pyx_pf_9numcodecs_5blosc_26_get_use_threads(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_proc = NULL; + PyObject *__pyx_v__use_threads = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_get_use_threads", 0); + + /* "numcodecs/blosc.pyx":478 + * def _get_use_threads(): + * global use_threads + * proc = multiprocessing.current_process() # <<<<<<<<<<<<<< + * + * # check if locks are available, and if not no threads + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { @@ -4664,27 +5353,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_proc = __pyx_t_1; __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":406 + /* "numcodecs/blosc.pyx":481 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< * return False * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = ((!__pyx_t_4) != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":407 + /* "numcodecs/blosc.pyx":482 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -4696,7 +5385,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":406 + /* "numcodecs/blosc.pyx":481 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -4705,25 +5394,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":410 + /* "numcodecs/blosc.pyx":485 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< * # If this module has been imported in the parent process, and the current process * # is a fork, attempting to use blosc in multi-threaded mode will cause a */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":414 + /* "numcodecs/blosc.pyx":489 * # is a fork, attempting to use blosc in multi-threaded mode will cause a * # program hang, so we force use of blosc ctx functions, i.e., no threads. * return False # <<<<<<<<<<<<<< @@ -4735,7 +5424,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":410 + /* "numcodecs/blosc.pyx":485 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -4744,25 +5433,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":416 + /* "numcodecs/blosc.pyx":491 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< * # user has manually overridden the default behaviour * _use_threads = use_threads */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -4770,19 +5459,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":418 + /* "numcodecs/blosc.pyx":493 * if use_threads in [True, False]: * # user has manually overridden the default behaviour * _use_threads = use_threads # <<<<<<<<<<<<<< * * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":416 + /* "numcodecs/blosc.pyx":491 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -4792,7 +5481,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":427 + /* "numcodecs/blosc.pyx":502 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -4800,13 +5489,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO * elif hasattr(threading, 'main_thread'): */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_MainProcess, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_MainProcess, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":428 + /* "numcodecs/blosc.pyx":503 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -4816,7 +5505,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":427 + /* "numcodecs/blosc.pyx":502 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -4826,30 +5515,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":429 + /* "numcodecs/blosc.pyx":504 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< * _use_threads = (threading.main_thread() == threading.current_thread()) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_u_main_thread); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_4 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_u_main_thread); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":430 + /* "numcodecs/blosc.pyx":505 * _use_threads = False * elif hasattr(threading, 'main_thread'): * _use_threads = (threading.main_thread() == threading.current_thread()) # <<<<<<<<<<<<<< * else: * _use_threads = threading.current_thread().name == 'MainThread' */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_main_thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_main_thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4864,12 +5553,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4884,16 +5573,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; - /* "numcodecs/blosc.pyx":429 + /* "numcodecs/blosc.pyx":504 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -4903,7 +5592,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":432 + /* "numcodecs/blosc.pyx":507 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -4911,9 +5600,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO * return _use_threads */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -4928,13 +5617,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_n_u_MainThread, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_n_u_MainThread, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -4943,7 +5632,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":434 + /* "numcodecs/blosc.pyx":509 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -4955,7 +5644,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":401 + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -4979,7 +5668,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":471 +/* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -4987,14 +5676,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO * if isinstance(cname, str): */ -static PyObject *__pyx_pf_9numcodecs_5blosc_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5008,7 +5697,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26__defaults__(CYTHON_UNUSED PyObjec __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_blocksize); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_blocksize); PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_blocksize); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -5101,7 +5790,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_1__init__(PyObject *__pyx_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 471, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 546, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5126,7 +5815,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_1__init__(PyObject *__pyx_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 471, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 546, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5149,16 +5838,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":472 + /* "numcodecs/blosc.pyx":547 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname # <<<<<<<<<<<<<< * if isinstance(cname, str): * self._cname_bytes = cname.encode('ascii') */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 472, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":548 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5169,14 +5858,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "numcodecs/blosc.pyx":474 + /* "numcodecs/blosc.pyx":549 * self.cname = cname * if isinstance(cname, str): * self._cname_bytes = cname.encode('ascii') # <<<<<<<<<<<<<< * else: * self._cname_bytes = cname */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5190,13 +5879,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":548 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5206,7 +5895,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":551 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -5214,38 +5903,38 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje * self.shuffle = shuffle */ /*else*/ { - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 551, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":552 * else: * self._cname_bytes = cname * self.clevel = clevel # <<<<<<<<<<<<<< * self.shuffle = shuffle * self.blocksize = blocksize */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 477, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 552, __pyx_L1_error) - /* "numcodecs/blosc.pyx":478 + /* "numcodecs/blosc.pyx":553 * self._cname_bytes = cname * self.clevel = clevel * self.shuffle = shuffle # <<<<<<<<<<<<<< * self.blocksize = blocksize * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 478, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":554 * self.clevel = clevel * self.shuffle = shuffle * self.blocksize = blocksize # <<<<<<<<<<<<<< * * def encode(self, buf): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 479, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5268,7 +5957,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":481 +/* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -5309,11 +5998,11 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_3encode(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 481, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 556, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 556, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5326,7 +6015,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_3encode(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 481, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 556, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5354,16 +6043,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":482 + /* "numcodecs/blosc.pyx":557 * * def encode(self, buf): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5380,7 +6069,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5389,14 +6078,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5407,7 +6096,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -5415,7 +6104,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":483 + /* "numcodecs/blosc.pyx":558 * def encode(self, buf): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) # <<<<<<<<<<<<<< @@ -5423,15 +6112,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec * def decode(self, buf, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -5448,7 +6137,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_v_buf, __pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5460,7 +6149,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_v_buf, __pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5470,7 +6159,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec } else #endif { - __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -5490,7 +6179,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -5499,7 +6188,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -5526,7 +6215,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":485 +/* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -5571,7 +6260,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 485, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 560, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -5581,7 +6270,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 560, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5599,7 +6288,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 560, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5624,16 +6313,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":486 + /* "numcodecs/blosc.pyx":561 * * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< * return decompress(buf, out) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5650,7 +6339,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5659,14 +6348,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5677,7 +6366,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -5685,15 +6374,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":487 + /* "numcodecs/blosc.pyx":562 * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * - * def __repr__(self): + * def decode_partial(self, buf, int start, int nitems, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -5710,7 +6399,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_buf, __pyx_v_out}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -5718,13 +6407,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_buf, __pyx_v_out}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -5735,7 +6424,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_out); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -5744,12 +6433,254 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * - * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress(buf, out) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buf); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "numcodecs/blosc.pyx":564 + * return decompress(buf, out) + * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_9numcodecs_5blosc_5Blosc_6decode_partial[] = "Blosc.decode_partial(self, buf, int start, int nitems, out=None)\n**Experimental**"; +static PyMethodDef __pyx_mdef_9numcodecs_5blosc_5Blosc_7decode_partial = {"decode_partial", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9numcodecs_5blosc_5Blosc_6decode_partial}; +static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_buf = 0; + int __pyx_v_start; + int __pyx_v_nitems; + PyObject *__pyx_v_out = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("decode_partial (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_buf,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_out,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[4] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 1); __PYX_ERR(0, 564, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 2); __PYX_ERR(0, 564, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nitems)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 3); __PYX_ERR(0, 564, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 564, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_buf = values[1]; + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L3_error) + __pyx_v_out = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 564, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(__pyx_self, __pyx_v_self, __pyx_v_buf, __pyx_v_start, __pyx_v_nitems, __pyx_v_out); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, int __pyx_v_start, int __pyx_v_nitems, PyObject *__pyx_v_out) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("decode_partial", 0); + __Pyx_INCREF(__pyx_v_buf); + + /* "numcodecs/blosc.pyx":566 + * def decode_partial(self, buf, int start, int nitems, out=None): + * '''**Experimental**''' + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< + * return decompress_partial(buf, start, nitems, dest=out) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_max_buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_buf, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_buf); + __Pyx_GIVEREF(__pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_buf); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":567 + * '''**Experimental**''' + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, dest=out) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_buf); + __Pyx_GIVEREF(__pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buf); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "numcodecs/blosc.pyx":564 + * return decompress(buf, out) + * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) */ /* function exit code */ @@ -5759,7 +6690,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); @@ -5768,8 +6699,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":489 - * return decompress(buf, out) +/* "numcodecs/blosc.pyx":569 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -5777,21 +6708,21 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_9numcodecs_5blosc_5Blosc_6__repr__[] = "Blosc.__repr__(self)"; -static PyMethodDef __pyx_mdef_9numcodecs_5blosc_5Blosc_7__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9numcodecs_5blosc_5Blosc_7__repr__, METH_O, __pyx_doc_9numcodecs_5blosc_5Blosc_6__repr__}; -static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_9numcodecs_5blosc_5Blosc_8__repr__[] = "Blosc.__repr__(self)"; +static PyMethodDef __pyx_mdef_9numcodecs_5blosc_5Blosc_9__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9numcodecs_5blosc_5Blosc_9__repr__, METH_O, __pyx_doc_9numcodecs_5blosc_5Blosc_8__repr__}; +static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + __pyx_r = __pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5803,28 +6734,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":490 + /* "numcodecs/blosc.pyx":570 * * def __repr__(self): * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ # <<<<<<<<<<<<<< * (type(self).__name__, * self.cname, */ - __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":491 + /* "numcodecs/blosc.pyx":571 * def __repr__(self): * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, # <<<<<<<<<<<<<< * self.cname, * self.clevel, */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -5837,16 +6768,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u_cname_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_cname_2); - /* "numcodecs/blosc.pyx":492 + /* "numcodecs/blosc.pyx":572 * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, * self.cname, # <<<<<<<<<<<<<< * self.clevel, * _shuffle_repr[self.shuffle + 1], */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -5859,16 +6790,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u_clevel_2); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_clevel_2); - /* "numcodecs/blosc.pyx":493 + /* "numcodecs/blosc.pyx":573 * (type(self).__name__, * self.cname, * self.clevel, # <<<<<<<<<<<<<< * _shuffle_repr[self.shuffle + 1], * self.blocksize) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -5881,25 +6812,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u_shuffle_2); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_shuffle_2); - /* "numcodecs/blosc.pyx":494 + /* "numcodecs/blosc.pyx":574 * self.cname, * self.clevel, * _shuffle_repr[self.shuffle + 1], # <<<<<<<<<<<<<< * self.blocksize) * return r */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3; @@ -5912,15 +6843,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u_blocksize_2); PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u_blocksize_2); - /* "numcodecs/blosc.pyx":495 + /* "numcodecs/blosc.pyx":575 * self.clevel, * _shuffle_repr[self.shuffle + 1], * self.blocksize) # <<<<<<<<<<<<<< * return r */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -5933,20 +6864,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":490 + /* "numcodecs/blosc.pyx":570 * * def __repr__(self): * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ # <<<<<<<<<<<<<< * (type(self).__name__, * self.cname, */ - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 10, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 10, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "numcodecs/blosc.pyx":496 + /* "numcodecs/blosc.pyx":576 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -5956,8 +6887,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":489 - * return decompress(buf, out) + /* "numcodecs/blosc.pyx":569 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -6035,6 +6966,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Blosc___init, __pyx_k_Blosc___init, sizeof(__pyx_k_Blosc___init), 0, 0, 1, 1}, {&__pyx_n_s_Blosc___repr, __pyx_k_Blosc___repr, sizeof(__pyx_k_Blosc___repr), 0, 0, 1, 1}, {&__pyx_n_s_Blosc_decode, __pyx_k_Blosc_decode, sizeof(__pyx_k_Blosc_decode), 0, 0, 1, 1}, + {&__pyx_n_s_Blosc_decode_partial, __pyx_k_Blosc_decode_partial, sizeof(__pyx_k_Blosc_decode_partial), 0, 0, 1, 1}, {&__pyx_n_s_Blosc_encode, __pyx_k_Blosc_encode, sizeof(__pyx_k_Blosc_encode), 0, 0, 1, 1}, {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1}, {&__pyx_n_s_Codec, __pyx_k_Codec, sizeof(__pyx_k_Codec), 0, 0, 1, 1}, @@ -6086,7 +7018,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_current_process, __pyx_k_current_process, sizeof(__pyx_k_current_process), 0, 0, 1, 1}, {&__pyx_n_s_current_thread, __pyx_k_current_thread, sizeof(__pyx_k_current_thread), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_decode_partial, __pyx_k_decode_partial, sizeof(__pyx_k_decode_partial), 0, 0, 1, 1}, {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1}, + {&__pyx_n_s_decompress_partial, __pyx_k_decompress_partial, sizeof(__pyx_k_decompress_partial), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_buffer, __pyx_k_dest_buffer, sizeof(__pyx_k_dest_buffer), 0, 0, 1, 1}, {&__pyx_n_s_dest_nbytes, __pyx_k_dest_nbytes, sizeof(__pyx_k_dest_nbytes), 0, 0, 1, 1}, @@ -6095,11 +7029,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding_size, __pyx_k_encoding_size, sizeof(__pyx_k_encoding_size), 0, 0, 1, 1}, {&__pyx_n_s_ensure_contiguous_ndarray, __pyx_k_ensure_contiguous_ndarray, sizeof(__pyx_k_ensure_contiguous_ndarray), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_err_bad_cname, __pyx_k_err_bad_cname, sizeof(__pyx_k_err_bad_cname), 0, 0, 1, 1}, {&__pyx_kp_u_error_during_blosc_compression_d, __pyx_k_error_during_blosc_compression_d, sizeof(__pyx_k_error_during_blosc_compression_d), 0, 1, 0, 0}, {&__pyx_kp_u_error_during_blosc_decompression, __pyx_k_error_during_blosc_decompression, sizeof(__pyx_k_error_during_blosc_decompression), 0, 1, 0, 0}, + {&__pyx_kp_u_error_during_blosc_partial_decom, __pyx_k_error_during_blosc_partial_decom, sizeof(__pyx_k_error_during_blosc_partial_decom), 0, 1, 0, 0}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_kp_u_expected_one_of, __pyx_k_expected_one_of, sizeof(__pyx_k_expected_one_of), 0, 1, 0, 0}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, @@ -6127,6 +7063,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1}, + {&__pyx_n_s_nitems, __pyx_k_nitems, sizeof(__pyx_k_nitems), 0, 0, 1, 1}, + {&__pyx_n_s_nitems_bytes, __pyx_k_nitems_bytes, sizeof(__pyx_k_nitems_bytes), 0, 0, 1, 1}, {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1}, {&__pyx_n_s_numcodecs_blosc, __pyx_k_numcodecs_blosc, sizeof(__pyx_k_numcodecs_blosc), 0, 0, 1, 1}, {&__pyx_kp_s_numcodecs_blosc_pyx, __pyx_k_numcodecs_blosc_pyx, sizeof(__pyx_k_numcodecs_blosc_pyx), 0, 0, 1, 0}, @@ -6150,6 +7088,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_source_buffer, __pyx_k_source_buffer, sizeof(__pyx_k_source_buffer), 0, 0, 1, 1}, {&__pyx_n_s_source_ptr, __pyx_k_source_ptr, sizeof(__pyx_k_source_ptr), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_bytes, __pyx_k_start_bytes, sizeof(__pyx_k_start_bytes), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_typesize, __pyx_k_typesize, sizeof(__pyx_k_typesize), 0, 0, 1, 1}, @@ -6159,9 +7099,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 79, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 210, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 315, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6171,214 +7111,241 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "numcodecs/blosc.pyx":284 + /* "numcodecs/blosc.pyx":285 * # to ensure no-one else can modify the global context while we're setting it * # up and using it. * with mutex: # <<<<<<<<<<<<<< * * # set compressor */ - __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "numcodecs/blosc.pyx":86 + /* "numcodecs/blosc.pyx":87 * * * def init(): # <<<<<<<<<<<<<< * """Initialize the Blosc library environment.""" * blosc_init() */ - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_init, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error) - /* "numcodecs/blosc.pyx":91 + /* "numcodecs/blosc.pyx":92 * * * def destroy(): # <<<<<<<<<<<<<< * """Destroy the Blosc library environment.""" * blosc_destroy() */ - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_destroy, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_destroy, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 92, __pyx_L1_error) - /* "numcodecs/blosc.pyx":96 + /* "numcodecs/blosc.pyx":97 * * * def compname_to_compcode(cname): # <<<<<<<<<<<<<< * """Return the compressor code associated with the compressor name. If the compressor * name is not recognized, or there is not support for it in this build, -1 is returned */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_cname); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_cname); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_compname_to_compcode, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_compname_to_compcode, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 97, __pyx_L1_error) - /* "numcodecs/blosc.pyx":105 + /* "numcodecs/blosc.pyx":106 * * * def list_compressors(): # <<<<<<<<<<<<<< * """Get a list of compressors supported in the current build.""" * s = blosc_list_compressors() */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_list_compressors, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_list_compressors, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 106, __pyx_L1_error) - /* "numcodecs/blosc.pyx":112 + /* "numcodecs/blosc.pyx":113 * * * def get_nthreads(): # <<<<<<<<<<<<<< * """Get the number of threads that Blosc uses internally for compression and * decompression.""" */ - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_get_nthreads, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_get_nthreads, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 113, __pyx_L1_error) - /* "numcodecs/blosc.pyx":118 + /* "numcodecs/blosc.pyx":119 * * * def set_nthreads(int nthreads): # <<<<<<<<<<<<<< * """Set the number of threads that Blosc uses internally for compression and * decompression.""" */ - __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_nthreads, __pyx_n_s_nthreads); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_nthreads, __pyx_n_s_nthreads); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_set_nthreads, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_set_nthreads, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 119, __pyx_L1_error) - /* "numcodecs/blosc.pyx":124 + /* "numcodecs/blosc.pyx":125 * * * def cbuffer_sizes(source): # <<<<<<<<<<<<<< * """Return information about a compressed buffer, namely the number of uncompressed * bytes (`nbytes`) and compressed (`cbytes`). It also returns the `blocksize` (which */ - __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_nbytes, __pyx_n_s_cbytes, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_nbytes, __pyx_n_s_cbytes, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_sizes, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_sizes, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 125, __pyx_L1_error) - /* "numcodecs/blosc.pyx":152 + /* "numcodecs/blosc.pyx":153 * * * def cbuffer_complib(source): # <<<<<<<<<<<<<< * """Return the name of the compression library used to compress `source`.""" * cdef: */ - __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_complib); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_complib); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_complib, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_complib, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 153, __pyx_L1_error) - /* "numcodecs/blosc.pyx":171 + /* "numcodecs/blosc.pyx":172 * * * def cbuffer_metainfo(source): # <<<<<<<<<<<<<< * """Return some meta-information about the compressed buffer in `source`, including * the typesize, whether the shuffle or bit-shuffle filters were used, and the */ - __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_typesize, __pyx_n_s_flags, __pyx_n_s_shuffle, __pyx_n_s_memcpyed); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_source, __pyx_n_s_buffer, __pyx_n_s_typesize, __pyx_n_s_flags, __pyx_n_s_shuffle, __pyx_n_s_memcpyed); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_metainfo, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_cbuffer_metainfo, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 172, __pyx_L1_error) - /* "numcodecs/blosc.pyx":209 + /* "numcodecs/blosc.pyx":210 * * * def err_bad_cname(cname): # <<<<<<<<<<<<<< * raise ValueError('bad compressor or compressor not supported: %r; expected one of ' * '%s' % (cname, list_compressors())) */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_cname); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_cname); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_err_bad_cname, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_err_bad_cname, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 210, __pyx_L1_error) - /* "numcodecs/blosc.pyx":214 + /* "numcodecs/blosc.pyx":215 * * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, # <<<<<<<<<<<<<< * int blocksize=AUTOBLOCKS): * """Compress data. */ - __pyx_tuple__23 = PyTuple_Pack(14, __pyx_n_s_source, __pyx_n_s_cname, __pyx_n_s_clevel, __pyx_n_s_shuffle, __pyx_n_s_blocksize, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_nbytes, __pyx_n_s_itemsize, __pyx_n_s_cbytes, __pyx_n_s_dest, __pyx_n_s_cname_str, __pyx_n_s_compressor_set); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(14, __pyx_n_s_source, __pyx_n_s_cname, __pyx_n_s_clevel, __pyx_n_s_shuffle, __pyx_n_s_blocksize, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_nbytes, __pyx_n_s_itemsize, __pyx_n_s_cbytes, __pyx_n_s_dest, __pyx_n_s_cname_str, __pyx_n_s_compressor_set); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_compress, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_compress, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 215, __pyx_L1_error) - /* "numcodecs/blosc.pyx":322 + /* "numcodecs/blosc.pyx":323 * * * def decompress(source, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ - __pyx_tuple__25 = PyTuple_Pack(12, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __pyx_n_s_dest_nbytes, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(12, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __pyx_n_s_dest_nbytes, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decompress, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decompress, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 323, __pyx_L1_error) - /* "numcodecs/blosc.pyx":401 + /* "numcodecs/blosc.pyx":397 + * + * + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * """**Experimental** + * Decompress data of only a part of a buffer. + */ + __pyx_tuple__27 = PyTuple_Pack(14, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_encoding_size, __pyx_n_s_nitems_bytes, __pyx_n_s_start_bytes, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_dest_nbytes, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decompress_partial, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 397, __pyx_L1_error) + + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_get_use_threads, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_get_use_threads, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 476, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< * self.cname = cname * if isinstance(cname, str): */ - __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_cname, __pyx_n_s_clevel, __pyx_n_s_shuffle, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_init_2, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_cname, __pyx_n_s_clevel, __pyx_n_s_shuffle, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_init_2, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 546, __pyx_L1_error) - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_encode, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_encode, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 556, __pyx_L1_error) - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) */ - __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_out); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decode, 485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 485, __pyx_L1_error) - __pyx_tuple__35 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_out); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decode, 560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":564 * return decompress(buf, out) * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + */ + __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_decode_partial, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "numcodecs/blosc.pyx":569 + * return decompress_partial(buf, start, nitems, dest=out) + * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 569, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6785,181 +7752,181 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":59 + /* "numcodecs/blosc.pyx":60 * * * MAX_OVERHEAD = BLOSC_MAX_OVERHEAD # <<<<<<<<<<<<<< * MAX_BUFFERSIZE = BLOSC_MAX_BUFFERSIZE * MAX_THREADS = BLOSC_MAX_THREADS */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_OVERHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_OVERHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_OVERHEAD, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_OVERHEAD, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":60 + /* "numcodecs/blosc.pyx":61 * * MAX_OVERHEAD = BLOSC_MAX_OVERHEAD * MAX_BUFFERSIZE = BLOSC_MAX_BUFFERSIZE # <<<<<<<<<<<<<< * MAX_THREADS = BLOSC_MAX_THREADS * MAX_TYPESIZE = BLOSC_MAX_TYPESIZE */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_BUFFERSIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_BUFFERSIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_BUFFERSIZE, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_BUFFERSIZE, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":61 + /* "numcodecs/blosc.pyx":62 * MAX_OVERHEAD = BLOSC_MAX_OVERHEAD * MAX_BUFFERSIZE = BLOSC_MAX_BUFFERSIZE * MAX_THREADS = BLOSC_MAX_THREADS # <<<<<<<<<<<<<< * MAX_TYPESIZE = BLOSC_MAX_TYPESIZE * VERSION_STRING = BLOSC_VERSION_STRING */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_THREADS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_THREADS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_THREADS, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_THREADS, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":62 + /* "numcodecs/blosc.pyx":63 * MAX_BUFFERSIZE = BLOSC_MAX_BUFFERSIZE * MAX_THREADS = BLOSC_MAX_THREADS * MAX_TYPESIZE = BLOSC_MAX_TYPESIZE # <<<<<<<<<<<<<< * VERSION_STRING = BLOSC_VERSION_STRING * VERSION_DATE = BLOSC_VERSION_DATE */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_TYPESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_MAX_TYPESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_TYPESIZE, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_TYPESIZE, __pyx_t_2) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":63 + /* "numcodecs/blosc.pyx":64 * MAX_THREADS = BLOSC_MAX_THREADS * MAX_TYPESIZE = BLOSC_MAX_TYPESIZE * VERSION_STRING = BLOSC_VERSION_STRING # <<<<<<<<<<<<<< * VERSION_DATE = BLOSC_VERSION_DATE * VERSION_STRING = VERSION_STRING.decode() */ - __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_STRING)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_STRING)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":64 + /* "numcodecs/blosc.pyx":65 * MAX_TYPESIZE = BLOSC_MAX_TYPESIZE * VERSION_STRING = BLOSC_VERSION_STRING * VERSION_DATE = BLOSC_VERSION_DATE # <<<<<<<<<<<<<< * VERSION_STRING = VERSION_STRING.decode() * VERSION_DATE = VERSION_DATE.decode() */ - __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_DATE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_DATE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_DATE, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_DATE, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":65 + /* "numcodecs/blosc.pyx":66 * VERSION_STRING = BLOSC_VERSION_STRING * VERSION_DATE = BLOSC_VERSION_DATE * VERSION_STRING = VERSION_STRING.decode() # <<<<<<<<<<<<<< * VERSION_DATE = VERSION_DATE.decode() * __version__ = VERSION_STRING */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":66 + /* "numcodecs/blosc.pyx":67 * VERSION_DATE = BLOSC_VERSION_DATE * VERSION_STRING = VERSION_STRING.decode() * VERSION_DATE = VERSION_DATE.decode() # <<<<<<<<<<<<<< * __version__ = VERSION_STRING * NOSHUFFLE = BLOSC_NOSHUFFLE */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_DATE, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION_DATE, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":67 + /* "numcodecs/blosc.pyx":68 * VERSION_STRING = VERSION_STRING.decode() * VERSION_DATE = VERSION_DATE.decode() * __version__ = VERSION_STRING # <<<<<<<<<<<<<< * NOSHUFFLE = BLOSC_NOSHUFFLE * SHUFFLE = BLOSC_SHUFFLE */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":68 + /* "numcodecs/blosc.pyx":69 * VERSION_DATE = VERSION_DATE.decode() * __version__ = VERSION_STRING * NOSHUFFLE = BLOSC_NOSHUFFLE # <<<<<<<<<<<<<< * SHUFFLE = BLOSC_SHUFFLE * BITSHUFFLE = BLOSC_BITSHUFFLE */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_NOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_NOSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":69 + /* "numcodecs/blosc.pyx":70 * __version__ = VERSION_STRING * NOSHUFFLE = BLOSC_NOSHUFFLE * SHUFFLE = BLOSC_SHUFFLE # <<<<<<<<<<<<<< * BITSHUFFLE = BLOSC_BITSHUFFLE * # automatic shuffle */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_SHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_SHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":70 + /* "numcodecs/blosc.pyx":71 * NOSHUFFLE = BLOSC_NOSHUFFLE * SHUFFLE = BLOSC_SHUFFLE * BITSHUFFLE = BLOSC_BITSHUFFLE # <<<<<<<<<<<<<< * # automatic shuffle * AUTOSHUFFLE = -1 */ - __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_BITSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(BLOSC_BITSHUFFLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BITSHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BITSHUFFLE, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":72 + /* "numcodecs/blosc.pyx":73 * BITSHUFFLE = BLOSC_BITSHUFFLE * # automatic shuffle * AUTOSHUFFLE = -1 # <<<<<<<<<<<<<< * # automatic block size - let blosc decide * AUTOBLOCKS = 0 */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTOSHUFFLE, __pyx_int_neg_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTOSHUFFLE, __pyx_int_neg_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) - /* "numcodecs/blosc.pyx":74 + /* "numcodecs/blosc.pyx":75 * AUTOSHUFFLE = -1 * # automatic block size - let blosc decide * AUTOBLOCKS = 0 # <<<<<<<<<<<<<< * * # synchronization */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTOBLOCKS, __pyx_int_0) < 0) __PYX_ERR(0, 74, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_AUTOBLOCKS, __pyx_int_0) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - /* "numcodecs/blosc.pyx":77 + /* "numcodecs/blosc.pyx":78 * * # synchronization * try: # <<<<<<<<<<<<<< @@ -6975,25 +7942,25 @@ if (!__Pyx_RefNanny) { __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "numcodecs/blosc.pyx":78 + /* "numcodecs/blosc.pyx":79 * # synchronization * try: * mutex = multiprocessing.Lock() # <<<<<<<<<<<<<< * except OSError: * mutex = None */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L2_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L2_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L2_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mutex, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L2_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mutex, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L2_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":77 + /* "numcodecs/blosc.pyx":78 * * # synchronization * try: # <<<<<<<<<<<<<< @@ -7009,7 +7976,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":79 + /* "numcodecs/blosc.pyx":80 * try: * mutex = multiprocessing.Lock() * except OSError: # <<<<<<<<<<<<<< @@ -7019,19 +7986,19 @@ if (!__Pyx_RefNanny) { __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_6) { __Pyx_AddTraceback("numcodecs.blosc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 79, __pyx_L4_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 80, __pyx_L4_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); - /* "numcodecs/blosc.pyx":80 + /* "numcodecs/blosc.pyx":81 * mutex = multiprocessing.Lock() * except OSError: * mutex = None # <<<<<<<<<<<<<< * * # store ID of process that first loads the module, so we can detect a fork later */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mutex, Py_None) < 0) __PYX_ERR(0, 80, __pyx_L4_except_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mutex, Py_None) < 0) __PYX_ERR(0, 81, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7040,7 +8007,7 @@ if (!__Pyx_RefNanny) { goto __pyx_L4_except_error; __pyx_L4_except_error:; - /* "numcodecs/blosc.pyx":77 + /* "numcodecs/blosc.pyx":78 * * # synchronization * try: # <<<<<<<<<<<<<< @@ -7060,223 +8027,235 @@ if (!__Pyx_RefNanny) { __pyx_L7_try_end:; } - /* "numcodecs/blosc.pyx":83 + /* "numcodecs/blosc.pyx":84 * * # store ID of process that first loads the module, so we can detect a fork later * _importer_pid = os.getpid() # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_importer_pid, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_importer_pid, __pyx_t_7) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":86 + /* "numcodecs/blosc.pyx":87 * * * def init(): # <<<<<<<<<<<<<< * """Initialize the Blosc library environment.""" * blosc_init() */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_1init, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_1init, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":91 + /* "numcodecs/blosc.pyx":92 * * * def destroy(): # <<<<<<<<<<<<<< * """Destroy the Blosc library environment.""" * blosc_destroy() */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_3destroy, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_3destroy, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_7) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_7) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":96 + /* "numcodecs/blosc.pyx":97 * * * def compname_to_compcode(cname): # <<<<<<<<<<<<<< * """Return the compressor code associated with the compressor name. If the compressor * name is not recognized, or there is not support for it in this build, -1 is returned */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5compname_to_compcode, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5compname_to_compcode, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compname_to_compcode, __pyx_t_7) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compname_to_compcode, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":105 + /* "numcodecs/blosc.pyx":106 * * * def list_compressors(): # <<<<<<<<<<<<<< * """Get a list of compressors supported in the current build.""" * s = blosc_list_compressors() */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_7list_compressors, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_7list_compressors, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_compressors, __pyx_t_7) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_compressors, __pyx_t_7) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":112 + /* "numcodecs/blosc.pyx":113 * * * def get_nthreads(): # <<<<<<<<<<<<<< * """Get the number of threads that Blosc uses internally for compression and * decompression.""" */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_9get_nthreads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_9get_nthreads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_nthreads, __pyx_t_7) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_nthreads, __pyx_t_7) < 0) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":118 + /* "numcodecs/blosc.pyx":119 * * * def set_nthreads(int nthreads): # <<<<<<<<<<<<<< * """Set the number of threads that Blosc uses internally for compression and * decompression.""" */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_11set_nthreads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_11set_nthreads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_nthreads, __pyx_t_7) < 0) __PYX_ERR(0, 118, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_nthreads, __pyx_t_7) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":124 + /* "numcodecs/blosc.pyx":125 * * * def cbuffer_sizes(source): # <<<<<<<<<<<<<< * """Return information about a compressed buffer, namely the number of uncompressed * bytes (`nbytes`) and compressed (`cbytes`). It also returns the `blocksize` (which */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_13cbuffer_sizes, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_13cbuffer_sizes, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_sizes, __pyx_t_7) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_sizes, __pyx_t_7) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":152 + /* "numcodecs/blosc.pyx":153 * * * def cbuffer_complib(source): # <<<<<<<<<<<<<< * """Return the name of the compression library used to compress `source`.""" * cdef: */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_15cbuffer_complib, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_15cbuffer_complib, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_complib, __pyx_t_7) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_complib, __pyx_t_7) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":171 + /* "numcodecs/blosc.pyx":172 * * * def cbuffer_metainfo(source): # <<<<<<<<<<<<<< * """Return some meta-information about the compressed buffer in `source`, including * the typesize, whether the shuffle or bit-shuffle filters were used, and the */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_17cbuffer_metainfo, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_17cbuffer_metainfo, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_metainfo, __pyx_t_7) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cbuffer_metainfo, __pyx_t_7) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":209 + /* "numcodecs/blosc.pyx":210 * * * def err_bad_cname(cname): # <<<<<<<<<<<<<< * raise ValueError('bad compressor or compressor not supported: %r; expected one of ' * '%s' % (cname, list_compressors())) */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_19err_bad_cname, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_19err_bad_cname, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_err_bad_cname, __pyx_t_7) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_err_bad_cname, __pyx_t_7) < 0) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":214 + /* "numcodecs/blosc.pyx":215 * * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, # <<<<<<<<<<<<<< * int blocksize=AUTOBLOCKS): * """Compress data. */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_k__2 = __pyx_t_6; - /* "numcodecs/blosc.pyx":215 + /* "numcodecs/blosc.pyx":216 * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, * int blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< * """Compress data. * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_k__3 = __pyx_t_6; - /* "numcodecs/blosc.pyx":214 + /* "numcodecs/blosc.pyx":215 * * * def compress(source, char* cname, int clevel, int shuffle=SHUFFLE, # <<<<<<<<<<<<<< * int blocksize=AUTOBLOCKS): * """Compress data. */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_21compress, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_21compress, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_7) < 0) __PYX_ERR(0, 214, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_7) < 0) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":322 + /* "numcodecs/blosc.pyx":323 * * * def decompress(source, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_23decompress, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_23decompress, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_7) < 0) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "numcodecs/blosc.pyx":397 + * + * + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * """**Experimental** + * Decompress data of only a part of a buffer. + */ + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_25decompress_partial, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_7) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress_partial, __pyx_t_7) < 0) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":398 + /* "numcodecs/blosc.pyx":473 * # set the value of this variable to True or False to override the * # default adaptive behaviour * use_threads = None # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 473, __pyx_L1_error) - /* "numcodecs/blosc.pyx":401 + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_25_get_use_threads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_27_get_use_threads, NULL, __pyx_n_s_numcodecs_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":437 + /* "numcodecs/blosc.pyx":512 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -7290,38 +8269,38 @@ if (!__Pyx_RefNanny) { __Pyx_INCREF(__pyx_n_u_BITSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_BITSHUFFLE); PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_u_BITSHUFFLE); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 437, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":515 * * * class Blosc(Codec): # <<<<<<<<<<<<<< * """Codec providing compression using the Blosc meta-compressor. * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_1, __pyx_n_s_Blosc, __pyx_n_s_Blosc, (PyObject *) NULL, __pyx_n_s_numcodecs_blosc, __pyx_kp_s_Codec_providing_compression_usin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_1, __pyx_n_s_Blosc, __pyx_n_s_Blosc, (PyObject *) NULL, __pyx_n_s_numcodecs_blosc, __pyx_kp_s_Codec_providing_compression_usin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":539 * """ * * codec_id = 'blosc' # <<<<<<<<<<<<<< * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 539, __pyx_L1_error) - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":540 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -7329,12 +8308,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 465, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":541 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -7342,12 +8321,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":467 + /* "numcodecs/blosc.pyx":542 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -7355,12 +8334,12 @@ if (!__Pyx_RefNanny) { * max_buffer_size = 2**31 - 1 */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BITSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":468 + /* "numcodecs/blosc.pyx":543 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -7368,96 +8347,109 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 468, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":469 + /* "numcodecs/blosc.pyx":544 * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE * max_buffer_size = 2**31 - 1 # <<<<<<<<<<<<<< * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 469, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 544, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< * self.cname = cname * if isinstance(cname, str): */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_1__init__, 0, __pyx_n_s_Blosc___init, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_1__init__, 0, __pyx_n_s_Blosc___init, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 471, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 546, __pyx_L1_error) __pyx_t_9 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_SHUFFLE); if (unlikely(!__pyx_t_9)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_SHUFFLE); } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_8)->__pyx_arg_shuffle = __pyx_t_9; __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_8)->__pyx_arg_blocksize = __pyx_t_9; __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_9numcodecs_5blosc_26__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_9numcodecs_5blosc_28__defaults__); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_3encode, 0, __pyx_n_s_Blosc_encode, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_3encode, 0, __pyx_n_s_Blosc_encode, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_5decode, 0, __pyx_n_s_Blosc_decode, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_5decode, 0, __pyx_n_s_Blosc_decode, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__35); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 485, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__37); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":564 * return decompress(buf, out) * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + */ + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_7decode_partial, 0, __pyx_n_s_Blosc_decode_partial, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__40); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_8) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "numcodecs/blosc.pyx":569 + * return decompress_partial(buf, start, nitems, dest=out) + * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_7__repr__, 0, __pyx_n_s_Blosc___repr, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9numcodecs_5blosc_5Blosc_9__repr__, 0, __pyx_n_s_Blosc___repr, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_8) < 0) __PYX_ERR(0, 489, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_8) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":515 * * * class Blosc(Codec): # <<<<<<<<<<<<<< * """Codec providing compression using the Blosc meta-compressor. * */ - __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -8531,60 +9523,236 @@ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, if (unlikely(!uval)) return NULL; udata = PyUnicode_AS_UNICODE(uval); #endif - if (uoffset > 0) { - i = 0; - if (prepend_sign) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); - i++; - } - for (; i < uoffset; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); - } + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned short uint16_t; + #else + typedef unsigned __int16 uint16_t; + #endif + #endif +#else + #include +#endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define GCC_DIAGNOSTIC +#endif +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(size_t)*3+2]; + char *dpos, *end = digits + sizeof(size_t)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + size_t remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (size_t) (remaining / (8*8)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (size_t) (remaining / (10*10)); + dpos -= 2; + *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (size_t) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + if (last_one_off) { + assert(*dpos == '0'); + dpos++; + } + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); } - for (i=0; i < clength; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else - { - PyObject *sign = NULL, *padding = NULL; - uval = NULL; - if (uoffset > 0) { - prepend_sign = !!prepend_sign; - if (uoffset > prepend_sign) { - padding = PyUnicode_FromOrdinal(padding_char); - if (likely(padding) && uoffset > prepend_sign + 1) { - PyObject *tmp; - PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign); - if (unlikely(!repeat)) goto done_or_error; - tmp = PyNumber_Multiply(padding, repeat); - Py_DECREF(repeat); - Py_DECREF(padding); - padding = tmp; - } - if (unlikely(!padding)) goto done_or_error; - } - if (prepend_sign) { - sign = PyUnicode_FromOrdinal('-'); - if (unlikely(!sign)) goto done_or_error; - } + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; } - uval = PyUnicode_DecodeASCII(chars, clength, NULL); - if (likely(uval) && padding) { - PyObject *tmp = PyNumber_Add(padding, uval); - Py_DECREF(uval); - uval = tmp; + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; } - if (likely(uval) && sign) { - PyObject *tmp = PyNumber_Add(sign, uval); - Py_DECREF(uval); - uval = tmp; + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); } -done_or_error: - Py_XDECREF(padding); - Py_XDECREF(sign); + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); } #endif - return uval; + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* CIntToPyUnicode */ @@ -8602,18 +9770,18 @@ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define GCC_DIAGNOSTIC #endif -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) { - char digits[sizeof(size_t)*3+2]; - char *dpos, *end = digits + sizeof(size_t)*3+2; +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(int)*3+2]; + char *dpos, *end = digits + sizeof(int)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; - size_t remaining; + int remaining; #ifdef GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; + const int neg_one = (int) -1, const_zero = (int) 0; #ifdef GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif @@ -8630,21 +9798,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssiz switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); - remaining = (size_t) (remaining / (8*8)); + remaining = (int) (remaining / (8*8)); dpos -= 2; *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); - remaining = (size_t) (remaining / (10*10)); + remaining = (int) (remaining / (10*10)); dpos -= 2; *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; - remaining = (size_t) (remaining / 16); + remaining = (int) (remaining / 16); break; default: assert(0); @@ -8994,93 +10162,6 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED } #endif -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { @@ -10296,6 +11377,37 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { return (target_type) value;\ } +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; @@ -10485,37 +11597,6 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index ebd22710..3bfdc00c 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -43,6 +43,7 @@ cdef extern from "blosc.h": int blosc_compress(int clevel, int doshuffle, size_t typesize, size_t nbytes, void* src, void* dest, size_t destsize) nogil int blosc_decompress(void *src, void *dest, size_t destsize) nogil + int blosc_getitem(void* src, int start, int nitems, void* dest) int blosc_compname_to_compcode(const char* compname) int blosc_compress_ctx(int clevel, int doshuffle, size_t typesize, size_t nbytes, const void* src, void* dest, size_t destsize, @@ -393,6 +394,80 @@ def decompress(source, dest=None): return dest +def decompress_partial(source, start, nitems, dest=None): + """**Experimental** + Decompress data of only a part of a buffer. + + Parameters + ---------- + source : bytes-like + Compressed data, including blosc header. Can be any object supporting the buffer + protocol. + start: int, + Offset in item where we want to start decoding + nitems: int + Number of items we want to decode + dest : array-like, optional + Object to decompress into. + + + Returns + ------- + dest : bytes + Object containing decompressed data. + + """ + cdef: + int ret + int encoding_size + int nitems_bytes + int start_bytes + char *source_ptr + char *dest_ptr + Buffer source_buffer + Buffer dest_buffer = None + + # setup source buffer + source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + source_ptr = source_buffer.ptr + + # get encoding size from source buffer header + encoding_size = source[3] + + # convert varibles to handle type and encoding sizes + nitems_bytes = nitems * encoding_size + start_bytes = (start * encoding_size) + + # setup destination buffer + if dest is None: + dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) + dest_ptr = PyBytes_AS_STRING(dest) + dest_nbytes = nitems_bytes + else: + arr = ensure_contiguous_ndarray(dest) + dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) + dest_ptr = dest_buffer.ptr + dest_nbytes = dest_buffer.nbytes + + # try decompression + try: + if dest_nbytes < nitems_bytes: + raise ValueError('destination buffer too small; expected at least %s, ' + 'got %s' % (nitems_bytes, dest_nbytes)) + ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + + finally: + source_buffer.release() + if dest_buffer is not None: + dest_buffer.release() + + # ret refers to the number of bytes returned from blosc_getitem. + if ret <= 0: + raise RuntimeError('error during blosc partial decompression: %d', ret) + + return dest + + # set the value of this variable to True or False to override the # default adaptive behaviour use_threads = None @@ -486,6 +561,11 @@ class Blosc(Codec): buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress(buf, out) + def decode_partial(self, buf, int start, int nitems, out=None): + '''**Experimental**''' + buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + return decompress_partial(buf, start, nitems, dest=out) + def __repr__(self): r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ (type(self).__name__, diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index 4acd18ad..c914e33e 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -111,6 +111,75 @@ def check_encode_decode(arr, codec, precision=None): compare_arrays(arr, out, precision=precision) +def check_encode_decode_partial(arr, codec, precision=None): + + # N.B., watch out here with blosc compressor, if the itemsize of + # the source buffer is different then the results of encoding + # (i.e., compression) may be different. Hence we *do not* require that + # the results of encoding be identical for all possible inputs, rather + # we just require that the results of the encode/decode round-trip can + # be compared to the original array. + + itemsize = arr.itemsize + start, nitems = 5, 10 + compare_arr = arr[start:start+nitems] + # test encoding of numpy array + enc = codec.encode(arr) + dec = codec.decode_partial(enc, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # out = np.empty_like(compare_arr) + out = np.empty_like(compare_arr) + print(len(out)) + + # test partial decode of encoded bytes + buf = arr.tobytes(order='A') + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test partial decode of encoded bytearray + buf = bytearray(arr.tobytes(order='A')) + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test partial decode of encoded array.array + buf = array.array('b', arr.tobytes(order='A')) + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # # decoding should support any object exporting the buffer protocol, + + # # setup + enc_bytes = ensure_bytes(enc) + + # test decoding of raw bytes into numpy array + dec = codec.decode_partial(enc_bytes, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test partial decoding of bytearray + dec = codec.decode_partial(bytearray(enc_bytes), start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test partial decoding of array.array + buf = array.array('b', enc_bytes) + dec = codec.decode_partial(buf, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding of numpy array into numpy array + buf = np.frombuffer(enc_bytes, dtype='u1') + dec = codec.decode_partial(buf, start*itemsize, nitems*itemsize, out=out) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding directly into bytearray + out = bytearray(compare_arr.nbytes) + codec.decode_partial(enc_bytes, start*itemsize, nitems*itemsize, out=out) + # noinspection PyTypeChecker + compare_arrays(compare_arr, out, precision=precision) + + def assert_array_items_equal(res, arr): assert isinstance(res, np.ndarray) diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index f69e39ff..edc14faf 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -8,7 +8,9 @@ from numcodecs import blosc from numcodecs.blosc import Blosc -from numcodecs.tests.common import (check_encode_decode, check_config, +from numcodecs.tests.common import (check_encode_decode, + check_encode_decode_partial, + check_config, check_backwards_compatibility, check_err_decode_object_buffer, check_err_encode_object_buffer, @@ -63,6 +65,14 @@ def test_encode_decode(array, codec): check_encode_decode(array, codec) +@pytest.mark.parametrize('codec', codecs) +@pytest.mark.parametrize('array', [pytest.param(x) if len(x.shape) == 1 + else pytest.param(x, marks=[pytest.mark.xfail]) + for x in arrays]) +def test_partial_decode(codec, array): + check_encode_decode_partial(array, codec) + + def test_config(): codec = Blosc(cname='zstd', clevel=3, shuffle=1) check_config(codec)