From bd6dfb1b0230cc7146a0ca819d296ad3461f2275 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Tue, 19 May 2020 14:48:35 -0600 Subject: [PATCH 01/20] adds partial decompression, not passing tests --- numcodecs/blosc.c | 2753 +++++++++++++++++++++++---------- numcodecs/blosc.pyx | 64 + numcodecs/compat_ext.c | 63 +- numcodecs/lz4.c | 13 +- numcodecs/tests/common.py | 74 +- numcodecs/tests/test_blosc.py | 9 +- numcodecs/vlen.c | 9 +- numcodecs/zstd.c | 77 +- 8 files changed, 2176 insertions(+), 886 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index fd5ef882..811d182b 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,16 @@ 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); +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); + +/* PyObjectFormat.proto */ +#if CYTHON_USE_UNICODE_WRITER +static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f); +#else +#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f) +#endif + /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); @@ -1535,6 +1551,7 @@ static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static const char __pyx_k_[] = ","; +static const char __pyx_k_d[] = "d"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__5[] = ")"; @@ -1567,6 +1584,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"; @@ -1579,15 +1597,18 @@ static const char __pyx_k_import[] = "__import__"; 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_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"; static const char __pyx_k_cname_2[] = "(cname="; static const char __pyx_k_complib[] = "complib"; static const char __pyx_k_destroy[] = "destroy"; +static const char __pyx_k_nbitems[] = "nbitems"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_shuffle[] = "shuffle"; +static const char __pyx_k_start_2[] = ", start: "; static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_clevel_2[] = ", clevel="; static const char __pyx_k_codec_id[] = "codec_id"; @@ -1595,6 +1616,7 @@ static const char __pyx_k_compress[] = "compress"; static const char __pyx_k_dest_ptr[] = "dest_ptr"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_memcpyed[] = "memcpyed"; +static const char __pyx_k_nbytes_2[] = "nbytes"; static const char __pyx_k_nthreads[] = "nthreads"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_typesize[] = "typesize"; @@ -1641,6 +1663,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 +1674,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 +1684,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: "; 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 +1696,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; @@ -1720,8 +1747,11 @@ static PyObject *__pyx_n_s_compress; 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_u_d; 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; @@ -1735,6 +1765,7 @@ 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; @@ -1761,7 +1792,10 @@ static PyObject *__pyx_n_s_multiprocessing; 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_nbitems; +static PyObject *__pyx_kp_u_nbytes; +static PyObject *__pyx_n_s_nbytes_2; +static PyObject *__pyx_n_s_nitems; static PyObject *__pyx_n_s_nthreads; static PyObject *__pyx_n_s_numcodecs_blosc; static PyObject *__pyx_kp_s_numcodecs_blosc_pyx; @@ -1785,6 +1819,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_kp_u_start_2; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_typesize; @@ -1803,14 +1839,17 @@ 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_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_2147483647; static PyObject *__pyx_int_neg_1; @@ -1831,7 +1870,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 +1890,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 +1923,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 +1932,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 +1947,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 +1975,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 +1984,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 +1999,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 +2034,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 +2045,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 +2066,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 +2081,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 +2089,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 +2118,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 +2150,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 +2183,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 +2197,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 +2211,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 +2240,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 +2269,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 +2277,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 +2302,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 +2320,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 +2341,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 +2349,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 +2374,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 +2410,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 +2427,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 +2442,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 +2461,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 +2482,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 +2505,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 +2538,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 +2555,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 +2605,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 +2623,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 +2646,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 +2683,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 +2700,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 +2715,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 +2736,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 +2758,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 +2768,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 +2790,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 +2798,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 +2814,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 +2822,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 +2841,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 +2864,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 +2898,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 +2914,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 +2932,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 +2946,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 +2958,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 +2996,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 +3046,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 +3068,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 +3084,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 +3143,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 +3176,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 +3205,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 +3219,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 +3236,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 +3252,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 +3262,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 +3272,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 +3300,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 +3323,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 +3331,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 +3349,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 +3357,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 +3436,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 +3445,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 +3466,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 +3487,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 +3502,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 +3520,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 +3535,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 +3544,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 +3554,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 +3575,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 +3589,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 +3598,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 +3613,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 +3623,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 +3642,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 +3661,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 +3682,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 +3708,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 +3723,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 +3733,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 +3749,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 +3759,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 +3781,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 +3790,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 +3814,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 +3847,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 +3857,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 +3885,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 +3894,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 +3913,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 +3938,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 +3984,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 +4000,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 +4047,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 +4057,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 +4074,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 +4090,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 +4099,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 +4110,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 +4131,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 +4140,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 +4150,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 +4158,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 +4172,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 +4195,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 +4211,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 +4223,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 +4232,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 +4242,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 +4258,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 +4275,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 +4308,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 +4329,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 +4351,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 +4361,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 +4380,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 +4390,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 +4406,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 +4416,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 +4438,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 +4447,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 +4462,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 +4502,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 +4524,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 +4573,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 +4583,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 +4611,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 +4623,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,87 +4648,754 @@ 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): # <<<<<<<<<<<<<< + * """Decompress data. + * */ /* 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)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\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_nbitems; + 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_nbytes; + size_t __pyx_v_cbytes; + size_t __pyx_v_blocksize; + 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; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + char *__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":416 + * cdef: + * int ret + * int nbitems = nitems * 4 # <<<<<<<<<<<<<< + * char *source_ptr + * char *dest_ptr + */ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_nbitems = __pyx_t_2; + + /* "numcodecs/blosc.pyx":420 + * char *dest_ptr + * Buffer source_buffer + * Buffer dest_buffer = None # <<<<<<<<<<<<<< + * size_t nbytes, cbytes, blocksize * - * # 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, 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_INCREF(Py_None); + __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); + + /* "numcodecs/blosc.pyx":423 + * size_t nbytes, cbytes, blocksize + * + * 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, 423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __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)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - __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) + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_proc = __pyx_t_1; + __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":406 + /* "numcodecs/blosc.pyx":424 * - * # check if locks are available, and if not no threads - * if not mutex: # <<<<<<<<<<<<<< - * return False + * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< * + * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = ((!__pyx_t_4) != 0); + __pyx_t_4 = __pyx_v_source_buffer->ptr; + __pyx_v_source_ptr = __pyx_t_4; + + /* "numcodecs/blosc.pyx":426 + * source_ptr = source_buffer.ptr + * + * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) # <<<<<<<<<<<<<< + * + * if dest is None: + */ + blosc_cbuffer_sizes(__pyx_v_source_ptr, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize)); + + /* "numcodecs/blosc.pyx":428 + * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + * + * if dest is None: # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * 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":429 + * + * if dest is None: + * dest = PyBytes_FromStringAndSize(NULL, nbitems) # <<<<<<<<<<<<<< + * dest_ptr = PyBytes_AS_STRING(dest) + * dest_nbytes = nbitems + */ + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbitems); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":430 + * if dest is None: + * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< + * dest_nbytes = nbitems + * else: + */ + __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); + + /* "numcodecs/blosc.pyx":431 + * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest_ptr = PyBytes_AS_STRING(dest) + * dest_nbytes = nbitems # <<<<<<<<<<<<<< + * else: + * arr = ensure_contiguous_ndarray(dest) + */ + __pyx_v_dest_nbytes = __pyx_v_nbitems; + + /* "numcodecs/blosc.pyx":428 + * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + * + * if dest is None: # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest_ptr = PyBytes_AS_STRING(dest) + */ + goto __pyx_L3; + } + + /* "numcodecs/blosc.pyx":433 + * dest_nbytes = nbitems + * 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_3, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dest); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":434 + * 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, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_arr); + __Pyx_GIVEREF(__pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":435 + * 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: + */ + __pyx_t_4 = __pyx_v_dest_buffer->ptr; + __pyx_v_dest_ptr = __pyx_t_4; + + /* "numcodecs/blosc.pyx":436 + * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) + * dest_ptr = dest_buffer.ptr + * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< + * try: + * + */ + __pyx_t_8 = __pyx_v_dest_buffer->nbytes; + __pyx_v_dest_nbytes = __pyx_t_8; + } + __pyx_L3:; + + /* "numcodecs/blosc.pyx":437 + * dest_ptr = dest_buffer.ptr + * dest_nbytes = dest_buffer.nbytes + * try: # <<<<<<<<<<<<<< + * + * if dest_nbytes < nitems: + */ + /*try:*/ { + + /* "numcodecs/blosc.pyx":439 + * try: + * + * if dest_nbytes < nitems: # <<<<<<<<<<<<<< + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems, dest_nbytes)) + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_dest_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nitems, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 439, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__pyx_t_6)) { + + /* "numcodecs/blosc.pyx":440 + * + * if dest_nbytes < nitems: + * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< + * 'got %s' % (nitems, dest_nbytes)) + * + */ + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __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_3, 0, __pyx_kp_u_destination_buffer_too_small_exp); + + /* "numcodecs/blosc.pyx":441 + * if dest_nbytes < nitems: + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems, dest_nbytes)) # <<<<<<<<<<<<<< + * + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + */ + __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_nitems), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10; + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_got); + __pyx_t_9 += 6; + __Pyx_GIVEREF(__pyx_kp_u_got); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_got); + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":440 + * + * if dest_nbytes < nitems: + * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< + * 'got %s' % (nitems, dest_nbytes)) + * + */ + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 440, __pyx_L5_error) + + /* "numcodecs/blosc.pyx":439 + * try: + * + * if dest_nbytes < nitems: # <<<<<<<<<<<<<< + * raise ValueError('destination buffer too small; expected at least %s, ' + * 'got %s' % (nitems, dest_nbytes)) + */ + } + + /* "numcodecs/blosc.pyx":443 + * 'got %s' % (nitems, dest_nbytes)) + * + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) # <<<<<<<<<<<<<< + * + * finally: + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 443, __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, 443, __pyx_L5_error) + __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_t_2, __pyx_t_11, __pyx_v_dest_ptr); + } + + /* "numcodecs/blosc.pyx":446 + * + * finally: + * source_buffer.release() # <<<<<<<<<<<<<< + * if dest_buffer is not None: + * dest_buffer.release() + */ + /*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, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "numcodecs/blosc.pyx":447 + * 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":448 + * source_buffer.release() + * if dest_buffer is not None: + * dest_buffer.release() # <<<<<<<<<<<<<< + * + * if ret <= 0: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "numcodecs/blosc.pyx":447 + * 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_3); __pyx_t_3 = 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_2 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + + /* "numcodecs/blosc.pyx":446 + * + * finally: + * source_buffer.release() # <<<<<<<<<<<<<< + * if dest_buffer is not None: + * dest_buffer.release() + */ + __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, 446, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "numcodecs/blosc.pyx":447 + * 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":448 + * source_buffer.release() + * if dest_buffer is not None: + * dest_buffer.release() # <<<<<<<<<<<<<< + * + * if ret <= 0: + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "numcodecs/blosc.pyx":447 + * 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_2; __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":450 + * dest_buffer.release() + * + * if ret <= 0: # <<<<<<<<<<<<<< + * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + * + */ + __pyx_t_6 = ((__pyx_v_ret <= 0) != 0); + if (unlikely(__pyx_t_6)) { + + /* "numcodecs/blosc.pyx":451 + * + * if ret <= 0: + * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) # <<<<<<<<<<<<<< + * + * return dest + */ + __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = 0; + __pyx_t_10 = 127; + __Pyx_INCREF(__pyx_kp_u_error_during_blosc_partial_decom); + __pyx_t_9 += 42; + __Pyx_GIVEREF(__pyx_kp_u_error_during_blosc_partial_decom); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_error_during_blosc_partial_decom); + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_ret, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_start_2); + __pyx_t_9 += 9; + __Pyx_GIVEREF(__pyx_kp_u_start_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_start_2); + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_start, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10; + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_kp_u_nbytes); + __pyx_t_9 += 10; + __Pyx_GIVEREF(__pyx_kp_u_nbytes); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_nbytes); + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 451, __pyx_L1_error) + + /* "numcodecs/blosc.pyx":450 + * dest_buffer.release() + * + * if ret <= 0: # <<<<<<<<<<<<<< + * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + * + */ + } + + /* "numcodecs/blosc.pyx":453 + * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + * + * 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): # <<<<<<<<<<<<<< + * """Decompress data. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __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":461 + * + * + * 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":463 + * 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, 463, __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, 463, __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)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __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, 463, __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":466 + * + * # 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, 466, __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, 466, __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":467 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -4696,7 +5407,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":466 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -4705,25 +5416,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":410 + /* "numcodecs/blosc.pyx":470 * * # 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, 470, __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, 470, __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, 470, __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, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":414 + /* "numcodecs/blosc.pyx":474 * # 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 +5446,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":470 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -4744,25 +5455,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":416 + /* "numcodecs/blosc.pyx":476 * 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, 476, __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, 476, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 476, __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, 476, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 476, __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 +5481,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":478 * 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, 478, __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":476 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -4792,7 +5503,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":427 + /* "numcodecs/blosc.pyx":487 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -4800,13 +5511,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, 487, __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, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":428 + /* "numcodecs/blosc.pyx":488 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -4816,7 +5527,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":487 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -4826,30 +5537,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":429 + /* "numcodecs/blosc.pyx":489 * 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, 489, __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, 489, __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":490 * _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, 490, __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, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4864,12 +5575,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, 490, __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, 490, __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, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4884,16 +5595,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, 490, __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, 490, __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":489 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -4903,7 +5614,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":432 + /* "numcodecs/blosc.pyx":492 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -4911,9 +5622,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, 492, __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, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -4928,13 +5639,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, 492, __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, 492, __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, 492, __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 +5654,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":434 + /* "numcodecs/blosc.pyx":494 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -4955,7 +5666,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":461 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -4979,7 +5690,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":471 +/* "numcodecs/blosc.pyx":531 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -4987,14 +5698,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, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5008,7 +5719,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, 531, __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 +5812,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, 531, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5126,7 +5837,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, 531, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5149,16 +5860,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":532 * * 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, 532, __pyx_L1_error) - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":533 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5169,14 +5880,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":534 * 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, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5190,13 +5901,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, 534, __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, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":533 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5206,7 +5917,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":536 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -5214,38 +5925,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, 536, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":537 * 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, 537, __pyx_L1_error) - /* "numcodecs/blosc.pyx":478 + /* "numcodecs/blosc.pyx":538 * 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, 538, __pyx_L1_error) - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":539 * 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, 539, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":531 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5268,7 +5979,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":481 +/* "numcodecs/blosc.pyx":541 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -5309,11 +6020,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, 541, __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, 541, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5326,7 +6037,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, 541, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5354,16 +6065,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":542 * * 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, 542, __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, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5380,7 +6091,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, 542, __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 +6100,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, 542, __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, 542, __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 +6118,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, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -5415,7 +6126,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":543 * 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 +6134,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, 543, __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, 543, __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, 543, __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, 543, __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, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -5448,7 +6159,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, 543, __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 +6171,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, 543, __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 +6181,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, 543, __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 +6201,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, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -5499,7 +6210,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":541 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -5526,7 +6237,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":485 +/* "numcodecs/blosc.pyx":545 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -5571,23 +6282,285 @@ 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, 545, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 545, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 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_out = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 545, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9numcodecs_5blosc_5Blosc_4decode(__pyx_self, __pyx_v_self, __pyx_v_buf, __pyx_v_out); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +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) { + 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", 0); + __Pyx_INCREF(__pyx_v_buf); + + /* "numcodecs/blosc.pyx":546 + * + * 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, 546, __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, 546, __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, 546, __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, 546, __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, 546, __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, 546, __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":547 + * def decode(self, buf, out=None): + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress(buf, out) # <<<<<<<<<<<<<< + * + * 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, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __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_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, 547, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #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, 547, __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, 547, __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; + } + __Pyx_INCREF(__pyx_v_buf); + __Pyx_GIVEREF(__pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_buf); + __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, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "numcodecs/blosc.pyx":545 + * 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) + */ + + /* 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":549 + * return decompress(buf, out) + * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, dest=out) + */ + +/* 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)"; +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, 549, __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, 549, __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, 549, __pyx_L3_error) } CYTHON_FALLTHROUGH; - case 2: + case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); - if (value) { values[2] = value; kw_args--; } + 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") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 549, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + 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; @@ -5595,24 +6568,26 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, } __pyx_v_self = values[0]; __pyx_v_buf = values[1]; - __pyx_v_out = values[2]; + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error) + __pyx_v_out = values[4]; } 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_partial", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 549, __pyx_L3_error) __pyx_L3_error:; - __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_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9numcodecs_5blosc_5Blosc_4decode(__pyx_self, __pyx_v_self, __pyx_v_buf, __pyx_v_out); + __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_4decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_out) { +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; @@ -5621,19 +6596,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("decode", 0); + __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":486 + /* "numcodecs/blosc.pyx":550 * - * def decode(self, buf, out=None): + * def decode_partial(self, buf, int start, int nitems, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< - * return decompress(buf, out) + * 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, 486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __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, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -5650,7 +6625,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, 550, __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 +6634,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, 550, __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, 550, __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 +6652,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, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -5685,71 +6660,49 @@ 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 - * def decode(self, buf, out=None): + /* "numcodecs/blosc.pyx":551 + * def decode_partial(self, buf, int start, int nitems, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) # <<<<<<<<<<<<<< + * return decompress_partial(buf, start, nitems, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ __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_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __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, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __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_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_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else - #endif - #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_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_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; - } - __Pyx_INCREF(__pyx_v_buf); - __Pyx_GIVEREF(__pyx_v_buf); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_buf); - __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __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, 551, __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, 551, __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, 551, __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":485 - * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) + /* "numcodecs/blosc.pyx":549 + * return decompress(buf, out) * - * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) + * return decompress_partial(buf, start, nitems, dest=out) */ /* function exit code */ @@ -5759,7 +6712,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 +6721,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":553 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -5777,21 +6730,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 +6756,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":554 * * 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, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":491 + /* "numcodecs/blosc.pyx":555 * 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, 555, __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, 555, __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 +6790,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":556 * 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, 556, __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, 556, __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 +6812,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":557 * (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, 557, __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, 557, __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 +6834,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":558 * 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, 558, __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, 558, __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, 558, __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, 558, __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, 558, __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 +6865,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":559 * 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, 559, __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, 559, __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 +6886,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":554 * * 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, 554, __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":560 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -5956,8 +6909,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":553 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -6035,6 +6988,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}, @@ -6085,8 +7039,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_compressor_set, __pyx_k_compressor_set, sizeof(__pyx_k_compressor_set), 0, 0, 1, 1}, {&__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_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 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}, @@ -6100,6 +7057,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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}, @@ -6126,7 +7084,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_mutex, __pyx_k_mutex, sizeof(__pyx_k_mutex), 0, 0, 1, 1}, {&__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_nbitems, __pyx_k_nbitems, sizeof(__pyx_k_nbitems), 0, 0, 1, 1}, + {&__pyx_kp_u_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 1, 0, 0}, + {&__pyx_n_s_nbytes_2, __pyx_k_nbytes_2, sizeof(__pyx_k_nbytes_2), 0, 0, 1, 1}, + {&__pyx_n_s_nitems, __pyx_k_nitems, sizeof(__pyx_k_nitems), 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 +7111,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_kp_u_start_2, __pyx_k_start_2, sizeof(__pyx_k_start_2), 0, 1, 0, 0}, {&__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 +7122,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 +7134,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_2, __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_2, __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_2, __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":397 + * + * + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * """Decompress data. + * + */ + __pyx_tuple__27 = PyTuple_Pack(15, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nbitems, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes_2, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __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, 15, 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":401 + /* "numcodecs/blosc.pyx":461 * * * 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, 461, __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, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 461, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":531 * 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, 531, __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, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 531, __pyx_L1_error) - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":541 * 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, 541, __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, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 541, __pyx_L1_error) - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":545 * 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, 545, __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, 545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":549 * return decompress(buf, out) * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, dest=out) + */ + __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, 549, __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, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "numcodecs/blosc.pyx":553 + * 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, 553, __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, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6390,6 +7380,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -6785,181 +7776,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 +7966,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 +8000,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 +8010,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 +8031,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 +8051,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): # <<<<<<<<<<<<<< + * """Decompress data. + * + */ + __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":458 * # 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, 458, __pyx_L1_error) - /* "numcodecs/blosc.pyx":401 + /* "numcodecs/blosc.pyx":461 * * * 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, 461, __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, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":437 + /* "numcodecs/blosc.pyx":497 * * * _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, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -7290,38 +8293,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, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":500 * * * 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, 500, __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, 500, __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, 500, __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, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":524 * """ * * 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, 524, __pyx_L1_error) - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":525 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -7329,12 +8332,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, 525, __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, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":526 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -7342,12 +8345,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, 526, __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, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":467 + /* "numcodecs/blosc.pyx":527 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -7355,12 +8358,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, 527, __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, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":468 + /* "numcodecs/blosc.pyx":528 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -7368,96 +8371,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, 528, __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, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":469 + /* "numcodecs/blosc.pyx":529 * 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, 529, __pyx_L1_error) - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":531 * 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, 531, __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, 531, __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, 531, __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, 531, __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, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":541 * 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, 541, __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, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":545 * 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, 545, __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, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":549 * return decompress(buf, out) * + * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, dest=out) + */ + __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, 549, __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, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "numcodecs/blosc.pyx":553 + * 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, 553, __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, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":500 * * * 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, 500, __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, 500, __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; @@ -8676,6 +9692,131 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssiz return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } +/* 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_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; + int remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 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 = (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 = (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 = (int) (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); +} + +/* PyObjectFormat */ +#if CYTHON_USE_UNICODE_WRITER +static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { + int ret; + _PyUnicodeWriter writer; + if (likely(PyFloat_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); +#else + _PyUnicodeWriter_Init(&writer); +#endif + ret = _PyFloat_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else if (likely(PyLong_CheckExact(obj))) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 + _PyUnicodeWriter_Init(&writer, 0); +#else + _PyUnicodeWriter_Init(&writer); +#endif + ret = _PyLong_FormatAdvancedWriter( + &writer, + obj, + format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); + } else { + return PyObject_Format(obj, format_spec); + } + if (unlikely(ret == -1)) { + _PyUnicodeWriter_Dealloc(&writer); + return NULL; + } + return _PyUnicodeWriter_Finish(&writer); +} +#endif + /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index ebd22710..c434fc3b 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,65 @@ def decompress(source, dest=None): return dest +def decompress_partial(source, start, nitems, dest=None): + """Decompress data. + + Parameters + ---------- + source : bytes-like + Compressed data, including blosc header. Can be any object supporting the buffer + protocol. + dest : array-like, optional + Object to decompress into. + + Returns + ------- + dest : bytes + Object containing decompressed data. + + """ + cdef: + int ret + int nbitems = nitems * 4 + char *source_ptr + char *dest_ptr + Buffer source_buffer + Buffer dest_buffer = None + size_t nbytes, cbytes, blocksize + + source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + source_ptr = source_buffer.ptr + + blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + + if dest is None: + dest = PyBytes_FromStringAndSize(NULL, nbitems) + dest_ptr = PyBytes_AS_STRING(dest) + dest_nbytes = nbitems + 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: + + if dest_nbytes < nitems: + raise ValueError('destination buffer too small; expected at least %s, ' + 'got %s' % (nitems, dest_nbytes)) + + ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + + finally: + source_buffer.release() + if dest_buffer is not None: + dest_buffer.release() + + if ret <= 0: + raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + + return dest + + # set the value of this variable to True or False to override the # default adaptive behaviour use_threads = None @@ -486,6 +546,10 @@ 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): + 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/compat_ext.c b/numcodecs/compat_ext.c index 7242cc29..dac8dbea 100644 --- a/numcodecs/compat_ext.c +++ b/numcodecs/compat_ext.c @@ -5,7 +5,8 @@ "distutils": { "depends": [], "extra_compile_args": [ - "-stdlib=libc++" + "-msse2", + "-mavx2" ], "name": "numcodecs.compat_ext", "sources": [ @@ -842,8 +843,8 @@ struct __pyx_obj_9numcodecs_10compat_ext_Buffer { * * * cdef class Buffer: # <<<<<<<<<<<<<< - * """Compatibility class to work around fact that array.array does not support - * new-style buffer interface in PY2.""" + * """Convenience class for buffer interface.""" + * */ struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer { @@ -1201,8 +1202,8 @@ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; /* Late includes */ -/* "numcodecs/compat_ext.pyx":16 - * new-style buffer interface in PY2.""" +/* "numcodecs/compat_ext.pyx":15 + * """Convenience class for buffer interface.""" * * def __cinit__(self, obj, flags): # <<<<<<<<<<<<<< * PyObject_GetBuffer(obj, &(self.buffer), flags) @@ -1240,11 +1241,11 @@ static int __pyx_pw_9numcodecs_10compat_ext_6Buffer_1__cinit__(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 16, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 15, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 15, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1257,7 +1258,7 @@ static int __pyx_pw_9numcodecs_10compat_ext_6Buffer_1__cinit__(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 16, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 15, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.compat_ext.Buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1278,17 +1279,17 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 Py_ssize_t __pyx_t_3; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "numcodecs/compat_ext.pyx":17 + /* "numcodecs/compat_ext.pyx":16 * * def __cinit__(self, obj, flags): * PyObject_GetBuffer(obj, &(self.buffer), flags) # <<<<<<<<<<<<<< * self.acquired = True * self.ptr = self.buffer.buf */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_2 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->buffer), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_t_2 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->buffer), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 16, __pyx_L1_error) - /* "numcodecs/compat_ext.pyx":18 + /* "numcodecs/compat_ext.pyx":17 * def __cinit__(self, obj, flags): * PyObject_GetBuffer(obj, &(self.buffer), flags) * self.acquired = True # <<<<<<<<<<<<<< @@ -1297,7 +1298,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 */ __pyx_v_self->acquired = 1; - /* "numcodecs/compat_ext.pyx":19 + /* "numcodecs/compat_ext.pyx":18 * PyObject_GetBuffer(obj, &(self.buffer), flags) * self.acquired = True * self.ptr = self.buffer.buf # <<<<<<<<<<<<<< @@ -1306,7 +1307,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 */ __pyx_v_self->ptr = ((char *)__pyx_v_self->buffer.buf); - /* "numcodecs/compat_ext.pyx":20 + /* "numcodecs/compat_ext.pyx":19 * self.acquired = True * self.ptr = self.buffer.buf * self.itemsize = self.buffer.itemsize # <<<<<<<<<<<<<< @@ -1316,7 +1317,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 __pyx_t_3 = __pyx_v_self->buffer.itemsize; __pyx_v_self->itemsize = __pyx_t_3; - /* "numcodecs/compat_ext.pyx":21 + /* "numcodecs/compat_ext.pyx":20 * self.ptr = self.buffer.buf * self.itemsize = self.buffer.itemsize * self.nbytes = self.buffer.len # <<<<<<<<<<<<<< @@ -1326,8 +1327,8 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 __pyx_t_3 = __pyx_v_self->buffer.len; __pyx_v_self->nbytes = __pyx_t_3; - /* "numcodecs/compat_ext.pyx":16 - * new-style buffer interface in PY2.""" + /* "numcodecs/compat_ext.pyx":15 + * """Convenience class for buffer interface.""" * * def __cinit__(self, obj, flags): # <<<<<<<<<<<<<< * PyObject_GetBuffer(obj, &(self.buffer), flags) @@ -1345,7 +1346,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 return __pyx_r; } -/* "numcodecs/compat_ext.pyx":23 +/* "numcodecs/compat_ext.pyx":22 * self.nbytes = self.buffer.len * * cpdef release(self): # <<<<<<<<<<<<<< @@ -1372,7 +1373,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9numcodecs_10compat_ext_6Buffer_3release)) { __Pyx_XDECREF(__pyx_r); @@ -1389,7 +1390,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -1410,7 +1411,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob #endif } - /* "numcodecs/compat_ext.pyx":24 + /* "numcodecs/compat_ext.pyx":23 * * cpdef release(self): * if self.acquired: # <<<<<<<<<<<<<< @@ -1420,7 +1421,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob __pyx_t_5 = (__pyx_v_self->acquired != 0); if (__pyx_t_5) { - /* "numcodecs/compat_ext.pyx":25 + /* "numcodecs/compat_ext.pyx":24 * cpdef release(self): * if self.acquired: * PyBuffer_Release(&(self.buffer)) # <<<<<<<<<<<<<< @@ -1429,7 +1430,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ PyBuffer_Release((&__pyx_v_self->buffer)); - /* "numcodecs/compat_ext.pyx":26 + /* "numcodecs/compat_ext.pyx":25 * if self.acquired: * PyBuffer_Release(&(self.buffer)) * self.acquired = False # <<<<<<<<<<<<<< @@ -1438,7 +1439,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ __pyx_v_self->acquired = 0; - /* "numcodecs/compat_ext.pyx":24 + /* "numcodecs/compat_ext.pyx":23 * * cpdef release(self): * if self.acquired: # <<<<<<<<<<<<<< @@ -1447,7 +1448,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ } - /* "numcodecs/compat_ext.pyx":23 + /* "numcodecs/compat_ext.pyx":22 * self.nbytes = self.buffer.len * * cpdef release(self): # <<<<<<<<<<<<<< @@ -1491,7 +1492,7 @@ static PyObject *__pyx_pf_9numcodecs_10compat_ext_6Buffer_2release(struct __pyx_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("release", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9numcodecs_10compat_ext_6Buffer_release(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9numcodecs_10compat_ext_6Buffer_release(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1508,7 +1509,7 @@ static PyObject *__pyx_pf_9numcodecs_10compat_ext_6Buffer_2release(struct __pyx_ return __pyx_r; } -/* "numcodecs/compat_ext.pyx":28 +/* "numcodecs/compat_ext.pyx":27 * self.acquired = False * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1531,16 +1532,16 @@ static void __pyx_pf_9numcodecs_10compat_ext_6Buffer_4__dealloc__(struct __pyx_o PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "numcodecs/compat_ext.pyx":29 + /* "numcodecs/compat_ext.pyx":28 * * def __dealloc__(self): * self.release() # <<<<<<<<<<<<<< */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/compat_ext.pyx":28 + /* "numcodecs/compat_ext.pyx":27 * self.acquired = False * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1735,7 +1736,7 @@ static PyTypeObject __pyx_type_9numcodecs_10compat_ext_Buffer = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Compatibility class to work around fact that array.array does not support\n new-style buffer interface in PY2.", /*tp_doc*/ + "Convenience class for buffer interface.", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ diff --git a/numcodecs/lz4.c b/numcodecs/lz4.c index 863cf389..319e191c 100644 --- a/numcodecs/lz4.c +++ b/numcodecs/lz4.c @@ -4,21 +4,22 @@ { "distutils": { "depends": [ - "c-blosc/internal-complibs/lz4-1.9.1/lz4.h", + "c-blosc/internal-complibs/lz4-1.9.2/lz4.h", "numcodecs/stdint_compat.h" ], "extra_compile_args": [ - "-stdlib=libc++" + "-msse2", + "-mavx2" ], "include_dirs": [ "numcodecs", - "c-blosc/internal-complibs/lz4-1.9.1" + "c-blosc/internal-complibs/lz4-1.9.2" ], "name": "numcodecs.lz4", "sources": [ "numcodecs/lz4.pyx", - "c-blosc/internal-complibs/lz4-1.9.1/lz4hc.c", - "c-blosc/internal-complibs/lz4-1.9.1/lz4.c" + "c-blosc/internal-complibs/lz4-1.9.2/lz4hc.c", + "c-blosc/internal-complibs/lz4-1.9.2/lz4.c" ] }, "module_name": "numcodecs.lz4" @@ -826,7 +827,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/lz4.pyx", - "type.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index 4acd18ad..e0bc7a6a 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -24,7 +24,8 @@ def compare_arrays(arr, res, precision=None): # ensure numpy array with matching dtype - res = ensure_ndarray(res).view(arr.dtype) + res = ensure_ndarray(res) + res = res.view(arr.dtype) # convert to correct shape if arr.flags.f_contiguous: @@ -111,6 +112,77 @@ 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. + + # encoding should support any object exporting the buffer protocol + + 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) + + # test encoding of bytes + buf = arr.tobytes(order='A') + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test encoding of bytearray + buf = bytearray(arr.tobytes(order='A')) + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test encoding of array.array + buf = array.array('b', arr.tobytes(order='A')) + enc = codec.encode(buf) + dec = codec.decode_partial(enc, start, nitems) + 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 + dec = codec.decode_partial(enc_bytes, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding of bytearray + dec = codec.decode_partial(bytearray(enc_bytes), start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding of array.array + buf = array.array('b', enc_bytes) + dec = codec.decode_partial(buf, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding of numpy array + buf = np.frombuffer(enc_bytes, dtype='u1') + dec = codec.decode_partial(buf, start, nitems) + compare_arrays(compare_arr, dec, precision=precision) + + # test decoding directly into numpy array + out = np.empty_like(arr) + codec.decode_partial(enc_bytes, start, nitems, out=out) + compare_arrays(compare_arr, out, precision=precision) + + # test decoding directly into bytearray + out = bytearray(arr.nbytes) + codec.decode_partial(enc_bytes, start, nitems, 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 39237d17..0c4aad80 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -1,6 +1,7 @@ import itertools from multiprocessing import Pool from multiprocessing.pool import ThreadPool +import logging import numpy as np @@ -9,7 +10,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, @@ -57,6 +60,10 @@ def test_encode_decode(): for arr, codec in itertools.product(arrays, codecs): check_encode_decode(arr, codec) +def test_partial_decode(): + for arr, codec in itertools.product(arrays, codecs): + check_encode_decode_partial(arr, codec) + def test_config(): codec = Blosc(cname='zstd', clevel=3, shuffle=1) diff --git a/numcodecs/vlen.c b/numcodecs/vlen.c index 4f8070d9..4a1fb4c1 100644 --- a/numcodecs/vlen.c +++ b/numcodecs/vlen.c @@ -7,7 +7,8 @@ "numcodecs/stdint_compat.h" ], "extra_compile_args": [ - "-stdlib=libc++" + "-msse2", + "-mavx2" ], "include_dirs": [ "numcodecs" @@ -826,9 +827,9 @@ static const char *__pyx_f[] = { "numcodecs/vlen.pyx", "stringsource", "numcodecs/compat_ext.pxd", - "type.pxd", - "bool.pxd", - "complex.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/bool.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/complex.pxd", }; /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; diff --git a/numcodecs/zstd.c b/numcodecs/zstd.c index 522e5516..26601564 100644 --- a/numcodecs/zstd.c +++ b/numcodecs/zstd.c @@ -4,50 +4,53 @@ { "distutils": { "depends": [ - "c-blosc/internal-complibs/zstd-1.4.1/zstd.h" + "c-blosc/internal-complibs/zstd-1.4.4/zstd.h" ], "extra_compile_args": [ - "-stdlib=libc++" + "-msse2", + "-mavx2" ], "include_dirs": [ - "c-blosc/internal-complibs/zstd-1.4.1", - "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/zstd-1.4.4", + "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.zstd", "sources": [ "numcodecs/zstd.pyx", - "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" ] }, "module_name": "numcodecs.zstd" @@ -854,7 +857,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/zstd.pyx", - "type.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ From 780e50992927decf0ddc4346a6f2242e088f8bc9 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 20 May 2020 11:28:19 -0600 Subject: [PATCH 02/20] work --- numcodecs/blosc.pyx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index c434fc3b..a8db9277 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -413,17 +413,28 @@ def decompress_partial(source, start, nitems, dest=None): """ cdef: int ret - int nbitems = nitems * 4 + int nbitems + ctype char *source_ptr char *dest_ptr Buffer source_buffer Buffer dest_buffer = None size_t nbytes, cbytes, blocksize + # size_t typesize, + # int shuffle, memcpyed + source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) source_ptr = source_buffer.ptr blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + typesize, shuffle, memcpyed = cbuffer_metainfo(source) + + print(typesize) + + nbitems = typesize * nitems + + print(nbitems) if dest is None: dest = PyBytes_FromStringAndSize(NULL, nbitems) @@ -436,7 +447,7 @@ def decompress_partial(source, start, nitems, dest=None): dest_nbytes = dest_buffer.nbytes try: - if dest_nbytes < nitems: + if dest_nbytes < nbitems: raise ValueError('destination buffer too small; expected at least %s, ' 'got %s' % (nitems, dest_nbytes)) From 1b994b211348253a839608bc002ebaca25f340de Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 20 May 2020 11:28:48 -0600 Subject: [PATCH 03/20] debugging --- numcodecs/tests/common.py | 2 ++ numcodecs/tests/test_blosc.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index e0bc7a6a..ead8356e 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -24,7 +24,9 @@ def compare_arrays(arr, res, precision=None): # ensure numpy array with matching dtype + print(res) res = ensure_ndarray(res) + print(res) res = res.view(arr.dtype) # convert to correct shape diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index 0c4aad80..f189912e 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -20,8 +20,8 @@ codecs = [ - Blosc(shuffle=Blosc.SHUFFLE), - Blosc(clevel=0, shuffle=Blosc.SHUFFLE), + Blosc(shuffle=Blosc.NOSHUFFLE), + Blosc(clevel=0, shuffle=Blosc.NOSHUFFLE), Blosc(cname='lz4', shuffle=Blosc.SHUFFLE), Blosc(cname='lz4', clevel=1, shuffle=Blosc.NOSHUFFLE), Blosc(cname='lz4', clevel=5, shuffle=Blosc.SHUFFLE), From 9e66051f85228f3454be890bd529048765d58ed7 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 20 May 2020 12:48:03 -0600 Subject: [PATCH 04/20] passes tests --- numcodecs/blosc.c | 1328 +++++++++++++++++++++------------ numcodecs/blosc.pyx | 44 +- numcodecs/tests/common.py | 32 +- numcodecs/tests/test_blosc.py | 14 +- tox.ini | 2 +- 5 files changed, 888 insertions(+), 532 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index 811d182b..b62fff66 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -1290,6 +1290,9 @@ 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); +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); @@ -1592,6 +1595,7 @@ static const char __pyx_k_clevel[] = "clevel"; static const char __pyx_k_compat[] = "compat"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; static const char __pyx_k_getpid[] = "getpid"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; @@ -1605,7 +1609,6 @@ static const char __pyx_k_SHUFFLE[] = "SHUFFLE"; static const char __pyx_k_cname_2[] = "(cname="; static const char __pyx_k_complib[] = "complib"; static const char __pyx_k_destroy[] = "destroy"; -static const char __pyx_k_nbitems[] = "nbitems"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_shuffle[] = "shuffle"; static const char __pyx_k_start_2[] = ", start: "; @@ -1642,6 +1645,8 @@ 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_blosc[] = "start_blosc"; +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__"; @@ -1656,7 +1661,10 @@ static const char __pyx_k_importer_pid[] = "_importer_pid"; 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_nbitems_blosc[] = "nbitems_blosc"; +static const char __pyx_k_nbitems_bytes[] = "nbitems_bytes"; static const char __pyx_k_source_buffer[] = "source_buffer"; static const char __pyx_k_use_threads_2[] = "_use_threads"; static const char __pyx_k_MAX_BUFFERSIZE[] = "MAX_BUFFERSIZE"; @@ -1679,6 +1687,7 @@ 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_the_start_size_is_not_a_divisor[] = "the start size is not a divisor of the start offset bytes we want {} {} {}"; 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 "; static const char __pyx_k_bad_compressor_or_compressor_not[] = "bad compressor or compressor not supported: "; static const char __pyx_k_destination_buffer_too_small_exp[] = "destination buffer too small; expected at least "; @@ -1686,6 +1695,7 @@ static const char __pyx_k_error_during_blosc_compression_d[] = "error during blo 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: "; static const char __pyx_k_invalid_shuffle_argument_expecte[] = "invalid shuffle argument; expected -1, 0, 1 or 2, found %r"; +static const char __pyx_k_the_encoding_size_is_not_a_divis[] = "the encoding size is not a divisor of the number of bytes we want"; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_AUTOBLOCKS; static PyObject *__pyx_n_s_AUTOSHUFFLE; @@ -1760,6 +1770,7 @@ 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; @@ -1769,6 +1780,7 @@ 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; +static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_nthreads; static PyObject *__pyx_n_s_get_use_threads; static PyObject *__pyx_n_s_getpid; @@ -1792,7 +1804,8 @@ static PyObject *__pyx_n_s_multiprocessing; static PyObject *__pyx_n_s_mutex; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_nbitems; +static PyObject *__pyx_n_s_nbitems_blosc; +static PyObject *__pyx_n_s_nbitems_bytes; static PyObject *__pyx_kp_u_nbytes; static PyObject *__pyx_n_s_nbytes_2; static PyObject *__pyx_n_s_nitems; @@ -1821,7 +1834,11 @@ static PyObject *__pyx_n_s_source_ptr; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_start; static PyObject *__pyx_kp_u_start_2; +static PyObject *__pyx_n_s_start_blosc; +static PyObject *__pyx_n_s_start_bytes; static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_u_the_encoding_size_is_not_a_divis; +static PyObject *__pyx_kp_u_the_start_size_is_not_a_divisor; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_typesize; static PyObject *__pyx_n_s_use_threads; @@ -1839,17 +1856,16 @@ 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_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_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_typesize, PyObject *__pyx_v_encoding_size, 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_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_6decode_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, int __pyx_v_start, int __pyx_v_nitems, int __pyx_v_typesize, int __pyx_v_encoding_size, 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_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_2147483647; static PyObject *__pyx_int_neg_1; @@ -4651,31 +4667,37 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ /* Python wrapper */ 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)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +static char __pyx_doc_9numcodecs_5blosc_24decompress_partial[] = "decompress_partial(source, start, nitems, typesize, encoding_size, dest=None)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\n start: int,\n Offset in inem where we want to start decoding\n nitems: int\n Number of item we want to decode\n typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\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_typesize = 0; + PyObject *__pyx_v_encoding_size = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __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); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_typesize,&__pyx_n_s_encoding_size,&__pyx_n_s_dest,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[5] = ((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 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + 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); @@ -4696,19 +4718,31 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx 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) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 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) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 2); __PYX_ERR(0, 397, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 3); __PYX_ERR(0, 397, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 4); __PYX_ERR(0, 397, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest); - if (value) { values[3] = value; kw_args--; } + if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -4716,9 +4750,11 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 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; @@ -4728,26 +4764,31 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx __pyx_v_source = values[0]; __pyx_v_start = values[1]; __pyx_v_nitems = values[2]; - __pyx_v_dest = values[3]; + __pyx_v_typesize = values[3]; + __pyx_v_encoding_size = values[4]; + __pyx_v_dest = values[5]; } 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_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 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); + __pyx_r = __pyx_pf_9numcodecs_5blosc_24decompress_partial(__pyx_self, __pyx_v_source, __pyx_v_start, __pyx_v_nitems, __pyx_v_typesize, __pyx_v_encoding_size, __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -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) { +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_typesize, PyObject *__pyx_v_encoding_size, PyObject *__pyx_v_dest) { int __pyx_v_ret; - int __pyx_v_nbitems; + int __pyx_v_nbitems_bytes; + int __pyx_v_nbitems_blosc; + int __pyx_v_start_bytes; + int __pyx_v_start_blosc; char *__pyx_v_source_ptr; char *__pyx_v_dest_ptr; struct __pyx_obj_9numcodecs_10compat_ext_Buffer *__pyx_v_source_buffer = 0; @@ -4762,38 +4803,86 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - char *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; 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_8 = NULL; + char *__pyx_t_9; + int __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_UCS4 __pyx_t_13; + int __pyx_t_14; + char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; __Pyx_RefNannySetupContext("decompress_partial", 0); __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":416 + /* "numcodecs/blosc.pyx":428 * cdef: * int ret - * int nbitems = nitems * 4 # <<<<<<<<<<<<<< + * int nbitems_bytes = nitems * typesize # <<<<<<<<<<<<<< + * int nbitems_blosc = nbitems_bytes // encoding_size + * int start_bytes = (start*typesize) + */ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_nbitems_bytes = __pyx_t_2; + + /* "numcodecs/blosc.pyx":429 + * int ret + * int nbitems_bytes = nitems * typesize + * int nbitems_blosc = nbitems_bytes // encoding_size # <<<<<<<<<<<<<< + * int start_bytes = (start*typesize) + * int start_blosc = start_bytes // encoding_size + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nbitems_blosc = __pyx_t_2; + + /* "numcodecs/blosc.pyx":430 + * int nbitems_bytes = nitems * typesize + * int nbitems_blosc = nbitems_bytes // encoding_size + * int start_bytes = (start*typesize) # <<<<<<<<<<<<<< + * int start_blosc = start_bytes // encoding_size + * char *source_ptr + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_start_bytes = __pyx_t_2; + + /* "numcodecs/blosc.pyx":431 + * int nbitems_blosc = nbitems_bytes // encoding_size + * int start_bytes = (start*typesize) + * int start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< * char *source_ptr * char *dest_ptr */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_3, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_nbitems = __pyx_t_2; + __pyx_v_start_blosc = __pyx_t_2; - /* "numcodecs/blosc.pyx":420 + /* "numcodecs/blosc.pyx":435 * char *dest_ptr * Buffer source_buffer * Buffer dest_buffer = None # <<<<<<<<<<<<<< @@ -4803,40 +4892,157 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_INCREF(Py_None); __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); - /* "numcodecs/blosc.pyx":423 + /* "numcodecs/blosc.pyx":438 * size_t nbytes, cbytes, blocksize * + * assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< + * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_the_encoding_size_is_not_a_divis); + __PYX_ERR(0, 438, __pyx_L1_error) + } + } + #endif + + /* "numcodecs/blosc.pyx":439 + * + * assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" + * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) # <<<<<<<<<<<<<< + * + * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Remainder(__pyx_t_6, __pyx_v_encoding_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_2 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_2 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_v_encoding_size, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_v_encoding_size, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(3+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_t_5); + __Pyx_INCREF(__pyx_v_encoding_size); + __Pyx_GIVEREF(__pyx_v_encoding_size); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_v_encoding_size); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_2, __pyx_t_7); + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 439, __pyx_L1_error) + } + } + #endif + + /* "numcodecs/blosc.pyx":441 + * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) + * * 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, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_source); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_3); + __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":424 + /* "numcodecs/blosc.pyx":442 * * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< * * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) */ - __pyx_t_4 = __pyx_v_source_buffer->ptr; - __pyx_v_source_ptr = __pyx_t_4; + __pyx_t_9 = __pyx_v_source_buffer->ptr; + __pyx_v_source_ptr = __pyx_t_9; - /* "numcodecs/blosc.pyx":426 + /* "numcodecs/blosc.pyx":444 * source_ptr = source_buffer.ptr * * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) # <<<<<<<<<<<<<< @@ -4845,234 +5051,227 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ blosc_cbuffer_sizes(__pyx_v_source_ptr, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize)); - /* "numcodecs/blosc.pyx":428 + /* "numcodecs/blosc.pyx":446 * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) * * if dest is None: # <<<<<<<<<<<<<< - * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest = PyBytes_FromStringAndSize(NULL, nbitems_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) { + __pyx_t_4 = (__pyx_v_dest == Py_None); + __pyx_t_10 = (__pyx_t_4 != 0); + if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":429 + /* "numcodecs/blosc.pyx":447 * * if dest is None: - * dest = PyBytes_FromStringAndSize(NULL, nbitems) # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) # <<<<<<<<<<<<<< * dest_ptr = PyBytes_AS_STRING(dest) - * dest_nbytes = nbitems + * dest_nbytes = nbitems_bytes */ - __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbitems); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_3); + __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":430 + /* "numcodecs/blosc.pyx":448 * if dest is None: - * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< - * dest_nbytes = nbitems + * dest_nbytes = nbitems_bytes * else: */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":431 - * dest = PyBytes_FromStringAndSize(NULL, nbitems) + /* "numcodecs/blosc.pyx":449 + * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) - * dest_nbytes = nbitems # <<<<<<<<<<<<<< + * dest_nbytes = nbitems_bytes # <<<<<<<<<<<<<< * else: * arr = ensure_contiguous_ndarray(dest) */ - __pyx_v_dest_nbytes = __pyx_v_nbitems; + __pyx_v_dest_nbytes = __pyx_v_nbitems_bytes; - /* "numcodecs/blosc.pyx":428 + /* "numcodecs/blosc.pyx":446 * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) * * if dest is None: # <<<<<<<<<<<<<< - * dest = PyBytes_FromStringAndSize(NULL, nbitems) + * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ goto __pyx_L3; } - /* "numcodecs/blosc.pyx":433 - * dest_nbytes = nbitems + /* "numcodecs/blosc.pyx":451 + * dest_nbytes = nbitems_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_3, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dest); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_arr = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dest); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_arr = __pyx_t_3; + __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":434 + /* "numcodecs/blosc.pyx":452 * 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, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_1)); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_3)); + __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":435 + /* "numcodecs/blosc.pyx":453 * 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: */ - __pyx_t_4 = __pyx_v_dest_buffer->ptr; - __pyx_v_dest_ptr = __pyx_t_4; + __pyx_t_9 = __pyx_v_dest_buffer->ptr; + __pyx_v_dest_ptr = __pyx_t_9; - /* "numcodecs/blosc.pyx":436 + /* "numcodecs/blosc.pyx":454 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< * try: * */ - __pyx_t_8 = __pyx_v_dest_buffer->nbytes; - __pyx_v_dest_nbytes = __pyx_t_8; + __pyx_t_11 = __pyx_v_dest_buffer->nbytes; + __pyx_v_dest_nbytes = __pyx_t_11; } __pyx_L3:; - /* "numcodecs/blosc.pyx":437 + /* "numcodecs/blosc.pyx":455 * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes * try: # <<<<<<<<<<<<<< * - * if dest_nbytes < nitems: + * if dest_nbytes < nbitems_bytes: */ /*try:*/ { - /* "numcodecs/blosc.pyx":439 + /* "numcodecs/blosc.pyx":457 * try: * - * if dest_nbytes < nitems: # <<<<<<<<<<<<<< + * if dest_nbytes < nbitems_bytes: # <<<<<<<<<<<<<< * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems, dest_nbytes)) */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_dest_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nitems, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 439, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__pyx_t_6)) { + __pyx_t_10 = ((__pyx_v_dest_nbytes < __pyx_v_nbitems_bytes) != 0); + if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":458 * - * if dest_nbytes < nitems: + * if dest_nbytes < nbitems_bytes: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems, dest_nbytes)) * */ - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L5_error) + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = 0; - __pyx_t_10 = 127; + __pyx_t_12 = 0; + __pyx_t_13 = 127; __Pyx_INCREF(__pyx_kp_u_destination_buffer_too_small_exp); - __pyx_t_9 += 48; + __pyx_t_12 += 48; __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_destination_buffer_too_small_exp); - /* "numcodecs/blosc.pyx":441 - * if dest_nbytes < nitems: + /* "numcodecs/blosc.pyx":459 + * if dest_nbytes < nbitems_bytes: * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems, dest_nbytes)) # <<<<<<<<<<<<<< * - * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + * ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) */ - __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_nitems), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_nitems), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10; - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_13; + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_got); - __pyx_t_9 += 6; + __pyx_t_12 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_got); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":440 + /* "numcodecs/blosc.pyx":458 * - * if dest_nbytes < nitems: + * if dest_nbytes < nbitems_bytes: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems, dest_nbytes)) * */ - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 440, __pyx_L5_error) + __PYX_ERR(0, 458, __pyx_L5_error) - /* "numcodecs/blosc.pyx":439 + /* "numcodecs/blosc.pyx":457 * try: * - * if dest_nbytes < nitems: # <<<<<<<<<<<<<< + * if dest_nbytes < nbitems_bytes: # <<<<<<<<<<<<<< * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems, dest_nbytes)) */ } - /* "numcodecs/blosc.pyx":443 + /* "numcodecs/blosc.pyx":461 * 'got %s' % (nitems, dest_nbytes)) * - * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) # <<<<<<<<<<<<<< + * ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) # <<<<<<<<<<<<<< * * finally: */ - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 443, __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, 443, __pyx_L5_error) - __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_t_2, __pyx_t_11, __pyx_v_dest_ptr); + __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nbitems_blosc, __pyx_v_dest_ptr); } - /* "numcodecs/blosc.pyx":446 + /* "numcodecs/blosc.pyx":464 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5081,33 +5280,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*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, 446, __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, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":447 + /* "numcodecs/blosc.pyx":465 * 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) { + __pyx_t_10 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_4 = (__pyx_t_10 != 0); + if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":448 + /* "numcodecs/blosc.pyx":466 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * * if ret <= 0: */ - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":447 + /* "numcodecs/blosc.pyx":465 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5121,55 +5320,58 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /*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_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_11 = __pyx_lineno; __pyx_t_2 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __pyx_t_2 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { - /* "numcodecs/blosc.pyx":446 + /* "numcodecs/blosc.pyx":464 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< * if dest_buffer is not None: * dest_buffer.release() */ - __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, 446, __pyx_L10_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, 464, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":447 + /* "numcodecs/blosc.pyx":465 * 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) { + __pyx_t_4 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_10 = (__pyx_t_4 != 0); + if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":448 + /* "numcodecs/blosc.pyx":466 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * * if ret <= 0: */ - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L10_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":447 + /* "numcodecs/blosc.pyx":465 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5179,97 +5381,97 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } } 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_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } - __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_2; __pyx_filename = __pyx_t_12; + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; + __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; 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_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } - __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; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; goto __pyx_L1_error; } __pyx_L6:; } - /* "numcodecs/blosc.pyx":450 + /* "numcodecs/blosc.pyx":468 * dest_buffer.release() * * if ret <= 0: # <<<<<<<<<<<<<< * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) * */ - __pyx_t_6 = ((__pyx_v_ret <= 0) != 0); - if (unlikely(__pyx_t_6)) { + __pyx_t_10 = ((__pyx_v_ret <= 0) != 0); + if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":451 + /* "numcodecs/blosc.pyx":469 * * if ret <= 0: * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) # <<<<<<<<<<<<<< * * return dest */ - __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = 0; - __pyx_t_10 = 127; + __pyx_t_12 = 0; + __pyx_t_13 = 127; __Pyx_INCREF(__pyx_kp_u_error_during_blosc_partial_decom); - __pyx_t_9 += 42; + __pyx_t_12 += 42; __Pyx_GIVEREF(__pyx_kp_u_error_during_blosc_partial_decom); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_error_during_blosc_partial_decom); - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_ret, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_ret, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_start_2); - __pyx_t_9 += 9; + __pyx_t_12 += 9; __Pyx_GIVEREF(__pyx_kp_u_start_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_start_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_start, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_start, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10; - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_13; + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_nbytes); - __pyx_t_9 += 10; + __pyx_t_12 += 10; __Pyx_GIVEREF(__pyx_kp_u_nbytes); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_nbytes); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); + __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 451, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) - /* "numcodecs/blosc.pyx":450 + /* "numcodecs/blosc.pyx":468 * dest_buffer.release() * * if ret <= 0: # <<<<<<<<<<<<<< @@ -5278,7 +5480,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":453 + /* "numcodecs/blosc.pyx":471 * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) * * return dest # <<<<<<<<<<<<<< @@ -5293,7 +5495,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ @@ -5302,7 +5504,10 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("numcodecs.blosc.decompress_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5315,7 +5520,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P return __pyx_r; } -/* "numcodecs/blosc.pyx":461 +/* "numcodecs/blosc.pyx":479 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5351,16 +5556,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":463 + /* "numcodecs/blosc.pyx":481 * 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, 463, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __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, 463, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5375,27 +5580,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 463, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __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":466 + /* "numcodecs/blosc.pyx":484 * * # 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, 466, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __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, 466, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 484, __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":467 + /* "numcodecs/blosc.pyx":485 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5407,7 +5612,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":484 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5416,25 +5621,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":470 + /* "numcodecs/blosc.pyx":488 * * # 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, 470, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __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, 470, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __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, 470, __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, 488, __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, 470, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":474 + /* "numcodecs/blosc.pyx":492 * # 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 # <<<<<<<<<<<<<< @@ -5446,7 +5651,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":470 + /* "numcodecs/blosc.pyx":488 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5455,25 +5660,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":494 * 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, 476, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __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, 476, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 476, __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, 494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 494, __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, 476, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 476, __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, 494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -5481,19 +5686,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":478 + /* "numcodecs/blosc.pyx":496 * 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, 478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":494 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5503,7 +5708,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":487 + /* "numcodecs/blosc.pyx":505 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5511,13 +5716,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 487, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __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, 487, __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, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":488 + /* "numcodecs/blosc.pyx":506 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5527,7 +5732,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":487 + /* "numcodecs/blosc.pyx":505 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5537,30 +5742,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":507 * 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, 489, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __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, 489, __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, 507, __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":490 + /* "numcodecs/blosc.pyx":508 * _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, 490, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __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, 490, __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, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5575,12 +5780,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 490, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __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, 490, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __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, 490, __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, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5595,16 +5800,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 490, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __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, 490, __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, 508, __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":489 + /* "numcodecs/blosc.pyx":507 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5614,7 +5819,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":492 + /* "numcodecs/blosc.pyx":510 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5622,9 +5827,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __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, 492, __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, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5639,13 +5844,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 492, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __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, 492, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __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, 492, __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, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -5654,7 +5859,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":494 + /* "numcodecs/blosc.pyx":512 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5666,7 +5871,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":461 + /* "numcodecs/blosc.pyx":479 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5690,7 +5895,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":531 +/* "numcodecs/blosc.pyx":549 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5705,7 +5910,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 531, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5719,7 +5924,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 531, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -5812,7 +6017,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, 531, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 549, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5837,7 +6042,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, 531, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 549, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5860,16 +6065,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":532 + /* "numcodecs/blosc.pyx":550 * * 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, 532, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 550, __pyx_L1_error) - /* "numcodecs/blosc.pyx":533 + /* "numcodecs/blosc.pyx":551 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5880,14 +6085,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":534 + /* "numcodecs/blosc.pyx":552 * 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, 534, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5901,13 +6106,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, 534, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __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, 534, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":533 + /* "numcodecs/blosc.pyx":551 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5917,7 +6122,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":536 + /* "numcodecs/blosc.pyx":554 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -5925,38 +6130,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, 536, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 554, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":537 + /* "numcodecs/blosc.pyx":555 * 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, 537, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - /* "numcodecs/blosc.pyx":538 + /* "numcodecs/blosc.pyx":556 * 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, 538, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 556, __pyx_L1_error) - /* "numcodecs/blosc.pyx":539 + /* "numcodecs/blosc.pyx":557 * 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, 539, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":549 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5979,7 +6184,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":541 +/* "numcodecs/blosc.pyx":559 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6020,11 +6225,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, 541, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 559, __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, 541, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 559, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6037,7 +6242,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, 541, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 559, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6065,16 +6270,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":542 + /* "numcodecs/blosc.pyx":560 * * 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, 542, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __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, 542, __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, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6091,7 +6296,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, 542, __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, 560, __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; @@ -6100,14 +6305,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, 542, __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, 560, __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, 542, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __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; @@ -6118,7 +6323,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, 542, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6126,7 +6331,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":543 + /* "numcodecs/blosc.pyx":561 * 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) # <<<<<<<<<<<<<< @@ -6134,15 +6339,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, 543, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __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, 543, __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, 561, __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, 543, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __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, 543, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __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, 543, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -6159,7 +6364,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, 543, __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, 561, __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; @@ -6171,7 +6376,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, 543, __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, 561, __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; @@ -6181,7 +6386,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, 543, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __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; @@ -6201,7 +6406,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, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6210,7 +6415,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":541 + /* "numcodecs/blosc.pyx":559 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6237,7 +6442,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":545 +/* "numcodecs/blosc.pyx":563 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6282,7 +6487,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, 545, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 563, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6292,7 +6497,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, 545, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 563, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6310,7 +6515,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, 545, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6335,16 +6540,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":546 + /* "numcodecs/blosc.pyx":564 * * 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, 546, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __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, 546, __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, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6361,7 +6566,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, 546, __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, 564, __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; @@ -6370,14 +6575,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, 546, __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, 564, __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, 546, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __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; @@ -6388,7 +6593,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, 546, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6396,15 +6601,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":547 + /* "numcodecs/blosc.pyx":565 * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * - * def decode_partial(self, buf, int start, int nitems, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -6421,7 +6626,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, 547, __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, 565, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6429,13 +6634,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, 547, __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, 565, __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, 547, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __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; @@ -6446,7 +6651,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, 547, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -6455,7 +6660,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":545 + /* "numcodecs/blosc.pyx":563 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6479,35 +6684,41 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":549 +/* "numcodecs/blosc.pyx":567 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, dest=out) + * return decompress_partial(buf, start, nitems, */ /* 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)"; +static char __pyx_doc_9numcodecs_5blosc_5Blosc_6decode_partial[] = "Blosc.decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None)"; 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; + int __pyx_v_typesize; + int __pyx_v_encoding_size; 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)); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_buf,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_typesize,&__pyx_n_s_encoding_size,&__pyx_n_s_out,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[6] = ((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 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -6530,35 +6741,49 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p 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, 549, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 1); __PYX_ERR(0, 567, __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, 549, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 2); __PYX_ERR(0, 567, __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, 549, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 3); __PYX_ERR(0, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 4); __PYX_ERR(0, 567, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 5); __PYX_ERR(0, 567, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); - if (value) { values[4] = value; kw_args--; } + if (value) { values[6] = 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, 549, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 567, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[4] = PyTuple_GET_ITEM(__pyx_args, 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); @@ -6568,26 +6793,28 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 549, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error) - __pyx_v_out = values[4]; + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_out = values[6]; } 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, 549, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 567, __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); + __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_typesize, __pyx_v_encoding_size, __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) { +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, int __pyx_v_typesize, int __pyx_v_encoding_size, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6596,19 +6823,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":550 + /* "numcodecs/blosc.pyx":568 * - * def decode_partial(self, buf, int start, int nitems, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< - * return decompress_partial(buf, start, nitems, dest=out) - * + * return decompress_partial(buf, start, nitems, + * typesize, encoding_size, dest=out) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __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, 550, __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, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6625,7 +6853,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 550, __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, 568, __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; @@ -6634,14 +6862,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 550, __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, 568, __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, 550, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __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; @@ -6652,7 +6880,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6660,49 +6888,91 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":551 - * def decode_partial(self, buf, int start, int nitems, out=None): + /* "numcodecs/blosc.pyx":569 + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, dest=out) # <<<<<<<<<<<<<< + * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< + * typesize, encoding_size, 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, 551, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __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, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __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, 551, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + + /* "numcodecs/blosc.pyx":570 + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, + * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "numcodecs/blosc.pyx":569 + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< + * typesize, encoding_size, dest=out) + * + */ + __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_buf); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __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, 551, __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, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + + /* "numcodecs/blosc.pyx":570 + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, + * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 570, __pyx_L1_error) + + /* "numcodecs/blosc.pyx":569 + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< + * typesize, encoding_size, dest=out) + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":567 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, dest=out) + * return decompress_partial(buf, start, nitems, */ /* function exit code */ @@ -6712,6 +6982,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6721,8 +6992,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":553 - * return decompress_partial(buf, start, nitems, dest=out) +/* "numcodecs/blosc.pyx":572 + * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -6756,28 +7027,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":554 + /* "numcodecs/blosc.pyx":573 * * 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, 554, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":555 + /* "numcodecs/blosc.pyx":574 * 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, 555, __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, 574, __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, 555, __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, 574, __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; @@ -6790,16 +7061,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":556 + /* "numcodecs/blosc.pyx":575 * 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, 556, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __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, 556, __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, 575, __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; @@ -6812,16 +7083,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":557 + /* "numcodecs/blosc.pyx":576 * (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, 557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __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, 557, __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, 576, __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; @@ -6834,25 +7105,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":558 + /* "numcodecs/blosc.pyx":577 * 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, 558, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __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, 558, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __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, 558, __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, 577, __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, 558, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __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, 558, __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, 577, __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; @@ -6865,15 +7136,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":559 + /* "numcodecs/blosc.pyx":578 * 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, 559, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __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, 559, __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, 578, __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; @@ -6886,20 +7157,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":554 + /* "numcodecs/blosc.pyx":573 * * 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, 554, __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, 573, __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":560 + /* "numcodecs/blosc.pyx":579 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -6909,8 +7180,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":553 - * return decompress_partial(buf, start, nitems, dest=out) + /* "numcodecs/blosc.pyx":572 + * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -7052,6 +7323,7 @@ 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}, @@ -7061,6 +7333,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_nthreads, __pyx_k_get_nthreads, sizeof(__pyx_k_get_nthreads), 0, 0, 1, 1}, {&__pyx_n_s_get_use_threads, __pyx_k_get_use_threads, sizeof(__pyx_k_get_use_threads), 0, 0, 1, 1}, {&__pyx_n_s_getpid, __pyx_k_getpid, sizeof(__pyx_k_getpid), 0, 0, 1, 1}, @@ -7084,7 +7357,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_mutex, __pyx_k_mutex, sizeof(__pyx_k_mutex), 0, 0, 1, 1}, {&__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_nbitems, __pyx_k_nbitems, sizeof(__pyx_k_nbitems), 0, 0, 1, 1}, + {&__pyx_n_s_nbitems_blosc, __pyx_k_nbitems_blosc, sizeof(__pyx_k_nbitems_blosc), 0, 0, 1, 1}, + {&__pyx_n_s_nbitems_bytes, __pyx_k_nbitems_bytes, sizeof(__pyx_k_nbitems_bytes), 0, 0, 1, 1}, {&__pyx_kp_u_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 1, 0, 0}, {&__pyx_n_s_nbytes_2, __pyx_k_nbytes_2, sizeof(__pyx_k_nbytes_2), 0, 0, 1, 1}, {&__pyx_n_s_nitems, __pyx_k_nitems, sizeof(__pyx_k_nitems), 0, 0, 1, 1}, @@ -7113,7 +7387,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_kp_u_start_2, __pyx_k_start_2, sizeof(__pyx_k_start_2), 0, 1, 0, 0}, + {&__pyx_n_s_start_blosc, __pyx_k_start_blosc, sizeof(__pyx_k_start_blosc), 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_kp_u_the_encoding_size_is_not_a_divis, __pyx_k_the_encoding_size_is_not_a_divis, sizeof(__pyx_k_the_encoding_size_is_not_a_divis), 0, 1, 0, 0}, + {&__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_k_the_start_size_is_not_a_divisor, sizeof(__pyx_k_the_start_size_is_not_a_divisor), 0, 1, 0, 0}, {&__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}, {&__pyx_n_s_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 1}, @@ -7283,92 +7561,92 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ - __pyx_tuple__27 = PyTuple_Pack(15, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nbitems, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes_2, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __pyx_n_s_dest_nbytes, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(20, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nbitems_bytes, __pyx_n_s_nbitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes_2, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __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, 15, 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) + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 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":461 + /* "numcodecs/blosc.pyx":479 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 461, __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, 479, __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, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 461, __pyx_L1_error) + __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, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 479, __pyx_L1_error) - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":549 * 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__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, 531, __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, 549, __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, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 531, __pyx_L1_error) + __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, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 549, __pyx_L1_error) - /* "numcodecs/blosc.pyx":541 + /* "numcodecs/blosc.pyx":559 * 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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 541, __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, 559, __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, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 541, __pyx_L1_error) + __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, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 559, __pyx_L1_error) - /* "numcodecs/blosc.pyx":545 + /* "numcodecs/blosc.pyx":563 * 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__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_out); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 545, __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, 563, __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, 545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 545, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 545, __pyx_L1_error) + __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, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":567 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, dest=out) + * return decompress_partial(buf, start, nitems, */ - __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, 549, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 567, __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, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 549, __pyx_L1_error) - __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - /* "numcodecs/blosc.pyx":553 - * return decompress_partial(buf, start, nitems, dest=out) + /* "numcodecs/blosc.pyx":572 + * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 553, __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, 572, __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, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 553, __pyx_L1_error) + __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, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7380,7 +7658,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -8242,7 +8519,7 @@ if (!__Pyx_RefNanny) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ @@ -8251,35 +8528,35 @@ if (!__Pyx_RefNanny) { 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":458 + /* "numcodecs/blosc.pyx":476 * # 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, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - /* "numcodecs/blosc.pyx":461 + /* "numcodecs/blosc.pyx":479 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 461, __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, 479, __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, 461, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":497 + /* "numcodecs/blosc.pyx":515 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -8293,38 +8570,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, 497, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":500 + /* "numcodecs/blosc.pyx":518 * * * 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, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __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, 500, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __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, 500, __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, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":524 + /* "numcodecs/blosc.pyx":542 * """ * * 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, 524, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 542, __pyx_L1_error) - /* "numcodecs/blosc.pyx":525 + /* "numcodecs/blosc.pyx":543 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8332,12 +8609,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __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_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":526 + /* "numcodecs/blosc.pyx":544 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8345,12 +8622,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __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, 526, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":527 + /* "numcodecs/blosc.pyx":545 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8358,12 +8635,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, 527, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __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, 527, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":528 + /* "numcodecs/blosc.pyx":546 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8371,109 +8648,109 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 528, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __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, 528, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":529 + /* "numcodecs/blosc.pyx":547 * 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, 529, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":549 * 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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __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, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 531, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 549, __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, 531, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 549, __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, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 549, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":541 + /* "numcodecs/blosc.pyx":559 * 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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 541, __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, 559, __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, 541, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":545 + /* "numcodecs/blosc.pyx":563 * 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__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __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, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 545, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":567 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, dest=out) + * return decompress_partial(buf, start, nitems, */ - __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, 549, __pyx_L1_error) + __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, 567, __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, 549, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_8) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":553 - * return decompress_partial(buf, start, nitems, dest=out) + /* "numcodecs/blosc.pyx":572 + * typesize, encoding_size, 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_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, 553, __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, 572, __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, 553, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_8) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":500 + /* "numcodecs/blosc.pyx":518 * * * 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, 500, __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, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 500, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 518, __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; @@ -9692,6 +9969,73 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssiz return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_TRUE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_FALSE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_FALSE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + /* CIntToPyUnicode */ #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index a8db9277..efa5993a 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -394,7 +394,7 @@ def decompress(source, dest=None): return dest -def decompress_partial(source, start, nitems, dest=None): +def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): """Decompress data. Parameters @@ -404,6 +404,15 @@ def decompress_partial(source, start, nitems, dest=None): protocol. dest : array-like, optional Object to decompress into. + start: int, + Offset in inem where we want to start decoding + nitems: int + Number of item we want to decode + typesize: int + Size in number of bytes of the type we want to decode. + encoding_size: int + Size in number of bytes at the time of encoding + Returns ------- @@ -411,35 +420,33 @@ def decompress_partial(source, start, nitems, dest=None): Object containing decompressed data. """ + # we do need both the typesize and the encoding size as nitems will be + # interpreted by blosc wrt the size of the item. + cdef: int ret - int nbitems - ctype + int nbitems_bytes = nitems * typesize + int nbitems_blosc = nbitems_bytes // encoding_size + int start_bytes = (start*typesize) + int start_blosc = start_bytes // encoding_size char *source_ptr char *dest_ptr Buffer source_buffer Buffer dest_buffer = None size_t nbytes, cbytes, blocksize - # size_t typesize, - # int shuffle, memcpyed + assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" + assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) source_ptr = source_buffer.ptr blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) - typesize, shuffle, memcpyed = cbuffer_metainfo(source) - - print(typesize) - - nbitems = typesize * nitems - - print(nbitems) if dest is None: - dest = PyBytes_FromStringAndSize(NULL, nbitems) + dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) dest_ptr = PyBytes_AS_STRING(dest) - dest_nbytes = nbitems + dest_nbytes = nbitems_bytes else: arr = ensure_contiguous_ndarray(dest) dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) @@ -447,11 +454,11 @@ def decompress_partial(source, start, nitems, dest=None): dest_nbytes = dest_buffer.nbytes try: - if dest_nbytes < nbitems: + if dest_nbytes < nbitems_bytes: raise ValueError('destination buffer too small; expected at least %s, ' 'got %s' % (nitems, dest_nbytes)) - ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) + ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) finally: source_buffer.release() @@ -557,9 +564,10 @@ 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): + def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - return decompress_partial(buf, start, nitems, dest=out) + return decompress_partial(buf, start, nitems, + typesize, encoding_size, dest=out) def __repr__(self): r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index ead8356e..39693af4 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -24,16 +24,15 @@ def compare_arrays(arr, res, precision=None): # ensure numpy array with matching dtype - print(res) - res = ensure_ndarray(res) - print(res) - res = res.view(arr.dtype) + res = ensure_ndarray(res).view(arr.dtype) # convert to correct shape if arr.flags.f_contiguous: order = 'F' else: order = 'C' + print(arr.shape) + print(res.shape) res = res.reshape(arr.shape, order=order) # exact compare @@ -125,29 +124,30 @@ def check_encode_decode_partial(arr, codec, precision=None): # encoding should support any object exporting the buffer protocol + ITEMSIZE = arr.dtype.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) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test encoding of bytes buf = arr.tobytes(order='A') enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test encoding of bytearray buf = bytearray(arr.tobytes(order='A')) enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test encoding of array.array buf = array.array('b', arr.tobytes(order='A')) enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # decoding should support any object exporting the buffer protocol, @@ -156,31 +156,31 @@ def check_encode_decode_partial(arr, codec, precision=None): enc_bytes = ensure_bytes(enc) # test decoding of raw bytes - dec = codec.decode_partial(enc_bytes, start, nitems) + dec = codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test decoding of bytearray - dec = codec.decode_partial(bytearray(enc_bytes), start, nitems) + dec = codec.decode_partial(bytearray(enc_bytes), start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test decoding of array.array buf = array.array('b', enc_bytes) - dec = codec.decode_partial(buf, start, nitems) + dec = codec.decode_partial(buf, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test decoding of numpy array buf = np.frombuffer(enc_bytes, dtype='u1') - dec = codec.decode_partial(buf, start, nitems) + dec = codec.decode_partial(buf, start, nitems, ITEMSIZE, 1) compare_arrays(compare_arr, dec, precision=precision) # test decoding directly into numpy array - out = np.empty_like(arr) - codec.decode_partial(enc_bytes, start, nitems, out=out) + out = np.empty_like(compare_arr) + codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1, out=out) compare_arrays(compare_arr, out, precision=precision) # test decoding directly into bytearray - out = bytearray(arr.nbytes) - codec.decode_partial(enc_bytes, start, nitems, out=out) + out = bytearray(compare_arr.nbytes) + codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1, out=out) # noinspection PyTypeChecker compare_arrays(compare_arr, out, precision=precision) diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index f189912e..c31193b9 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -20,8 +20,8 @@ codecs = [ - Blosc(shuffle=Blosc.NOSHUFFLE), - Blosc(clevel=0, shuffle=Blosc.NOSHUFFLE), + Blosc(shuffle=Blosc.SHUFFLE), + Blosc(clevel=0, shuffle=Blosc.SHUFFLE), Blosc(cname='lz4', shuffle=Blosc.SHUFFLE), Blosc(cname='lz4', clevel=1, shuffle=Blosc.NOSHUFFLE), Blosc(cname='lz4', clevel=5, shuffle=Blosc.SHUFFLE), @@ -60,9 +60,13 @@ def test_encode_decode(): for arr, codec in itertools.product(arrays, codecs): check_encode_decode(arr, codec) -def test_partial_decode(): - for arr, codec in itertools.product(arrays, codecs): - check_encode_decode_partial(arr, 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(): diff --git a/tox.ini b/tox.ini index 8d5e6531..031760c0 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ setenv = commands = python setup.py build_ext --inplace py35,py36,py37: pytest -v --cov=numcodecs numcodecs - py38: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs + py38: pytest -vvv --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs coverage report -m py38: flake8 numcodecs pip freeze From 4d53cfb17e7574e529496903520db010206a86c0 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 20 May 2020 12:50:21 -0600 Subject: [PATCH 05/20] turns back default vebosity on tests --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 031760c0..8d5e6531 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ setenv = commands = python setup.py build_ext --inplace py35,py36,py37: pytest -v --cov=numcodecs numcodecs - py38: pytest -vvv --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs + py38: pytest -v --cov=numcodecs --doctest-modules --doctest-glob=*.pyx numcodecs coverage report -m py38: flake8 numcodecs pip freeze From dad1f834aa1b9531c1b1ab6302e6378dd27c8c6e Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 20 May 2020 17:42:29 -0600 Subject: [PATCH 06/20] updates docs --- docs/blosc.rst | 2 ++ docs/release.rst | 3 +++ 2 files changed, 5 insertions(+) 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..4a316b99 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 ` + * Remove LegacyJSON codec. By :user:`James Bourbeau `, :issue:`226`. From 1aafd9dde302f8f34a47535e448446e9b7c9ccc1 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Thu, 21 May 2020 12:14:30 -0600 Subject: [PATCH 07/20] adds code to infer typesize/encoding size, cleans up code --- numcodecs/blosc.c | 1701 +++++++++++++++++++------------------ numcodecs/blosc.pyx | 55 +- numcodecs/lz4.c | 2 +- numcodecs/tests/common.py | 4 +- numcodecs/vlen.c | 6 +- numcodecs/zstd.c | 2 +- 6 files changed, 894 insertions(+), 876 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index b62fff66..0a507176 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -912,7 +912,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/blosc.pyx", - ".tox/py36/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ @@ -1293,16 +1293,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssiz /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* 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); -/* PyObjectFormat.proto */ -#if CYTHON_USE_UNICODE_WRITER -static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f); -#else -#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f) -#endif - /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); @@ -1332,28 +1347,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); @@ -1495,12 +1488,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 *); @@ -1554,7 +1547,6 @@ static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static const char __pyx_k_[] = ","; -static const char __pyx_k_d[] = "d"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__5[] = ")"; @@ -1601,7 +1593,7 @@ static const char __pyx_k_import[] = "__import__"; 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_nbytes[] = "nbytes"; static const char __pyx_k_nitems[] = "nitems"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_OSError[] = "OSError"; @@ -1611,7 +1603,6 @@ static const char __pyx_k_complib[] = "complib"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_shuffle[] = "shuffle"; -static const char __pyx_k_start_2[] = ", start: "; static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_clevel_2[] = ", clevel="; static const char __pyx_k_codec_id[] = "codec_id"; @@ -1619,7 +1610,6 @@ static const char __pyx_k_compress[] = "compress"; static const char __pyx_k_dest_ptr[] = "dest_ptr"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_memcpyed[] = "memcpyed"; -static const char __pyx_k_nbytes_2[] = "nbytes"; static const char __pyx_k_nthreads[] = "nthreads"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_typesize[] = "typesize"; @@ -1658,13 +1648,13 @@ 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_blosc[] = "nitems_blosc"; +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_nbitems_blosc[] = "nbitems_blosc"; -static const char __pyx_k_nbitems_bytes[] = "nbitems_bytes"; static const char __pyx_k_source_buffer[] = "source_buffer"; static const char __pyx_k_use_threads_2[] = "_use_threads"; static const char __pyx_k_MAX_BUFFERSIZE[] = "MAX_BUFFERSIZE"; @@ -1693,7 +1683,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: "; +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 const char __pyx_k_the_encoding_size_is_not_a_divis[] = "the encoding size is not a divisor of the number of bytes we want"; static PyObject *__pyx_kp_u_; @@ -1757,7 +1747,6 @@ static PyObject *__pyx_n_s_compress; 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_u_d; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_decode_partial; static PyObject *__pyx_n_s_decompress; @@ -1804,11 +1793,10 @@ static PyObject *__pyx_n_s_multiprocessing; static PyObject *__pyx_n_s_mutex; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_nbitems_blosc; -static PyObject *__pyx_n_s_nbitems_bytes; -static PyObject *__pyx_kp_u_nbytes; -static PyObject *__pyx_n_s_nbytes_2; +static PyObject *__pyx_n_s_nbytes; static PyObject *__pyx_n_s_nitems; +static PyObject *__pyx_n_s_nitems_blosc; +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; @@ -1833,7 +1821,6 @@ 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_kp_u_start_2; static PyObject *__pyx_n_s_start_blosc; static PyObject *__pyx_n_s_start_bytes; static PyObject *__pyx_n_s_test; @@ -1889,7 +1876,6 @@ static PyObject *__pyx_tuple__35; 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; @@ -1908,7 +1894,7 @@ static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__39; -static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__41; /* Late includes */ /* "numcodecs/blosc.pyx":87 @@ -4667,14 +4653,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ /* Python wrapper */ 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, typesize, encoding_size, dest=None)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\n start: int,\n Offset in inem where we want to start decoding\n nitems: int\n Number of item we want to decode\n typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\n \n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +static char __pyx_doc_9numcodecs_5blosc_24decompress_partial[] = "decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\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; @@ -4689,6 +4675,8 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_typesize,&__pyx_n_s_encoding_size,&__pyx_n_s_dest,0}; PyObject* values[6] = {0,0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_int_0); + values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -4718,25 +4706,25 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 1); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 6, 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, 5, 6, 2); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 6, 2); __PYX_ERR(0, 397, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 3); __PYX_ERR(0, 397, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize); + if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, 4); __PYX_ERR(0, 397, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size); + if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: @@ -4753,8 +4741,10 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + 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; @@ -4770,7 +4760,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 6, 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(); @@ -4785,30 +4775,27 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx 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_typesize, PyObject *__pyx_v_encoding_size, PyObject *__pyx_v_dest) { int __pyx_v_ret; - int __pyx_v_nbitems_bytes; - int __pyx_v_nbitems_blosc; + int __pyx_v_nitems_bytes; + int __pyx_v_nitems_blosc; int __pyx_v_start_bytes; int __pyx_v_start_blosc; 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_nbytes; - size_t __pyx_v_cbytes; - size_t __pyx_v_blocksize; size_t __pyx_v_dest_nbytes; PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_2 = NULL; + char *__pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - char *__pyx_t_9; + PyObject *__pyx_t_9 = NULL; int __pyx_t_10; size_t __pyx_t_11; Py_ssize_t __pyx_t_12; @@ -4822,456 +4809,514 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; __Pyx_RefNannySetupContext("decompress_partial", 0); + __Pyx_INCREF(__pyx_v_typesize); + __Pyx_INCREF(__pyx_v_encoding_size); __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":428 - * cdef: - * int ret - * int nbitems_bytes = nitems * typesize # <<<<<<<<<<<<<< - * int nbitems_blosc = nbitems_bytes // encoding_size - * int start_bytes = (start*typesize) + /* "numcodecs/blosc.pyx":435 + * char *dest_ptr + * Buffer source_buffer + * Buffer dest_buffer = None # <<<<<<<<<<<<<< + * + * # setup source buffer + */ + __Pyx_INCREF(Py_None); + __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); + + /* "numcodecs/blosc.pyx":438 + * + * # 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, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __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, 438, __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":439 + * # setup source buffer + * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< + * + * # determine encoding size and typesize if not given + */ + __pyx_t_3 = __pyx_v_source_buffer->ptr; + __pyx_v_source_ptr = __pyx_t_3; + + /* "numcodecs/blosc.pyx":442 + * + * # determine encoding size and typesize if not given + * if typesize == 0: # <<<<<<<<<<<<<< + * typesize = source[3] + * if encoding_size == 0: */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_nbitems_bytes = __pyx_t_2; + if (__pyx_t_4) { + + /* "numcodecs/blosc.pyx":443 + * # determine encoding size and typesize if not given + * if typesize == 0: + * typesize = source[3] # <<<<<<<<<<<<<< + * if encoding_size == 0: + * encoding_size = typesize + */ + __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, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_typesize, __pyx_t_1); + __pyx_t_1 = 0; + + /* "numcodecs/blosc.pyx":442 + * + * # determine encoding size and typesize if not given + * if typesize == 0: # <<<<<<<<<<<<<< + * typesize = source[3] + * if encoding_size == 0: + */ + } - /* "numcodecs/blosc.pyx":429 - * int ret - * int nbitems_bytes = nitems * typesize - * int nbitems_blosc = nbitems_bytes // encoding_size # <<<<<<<<<<<<<< - * int start_bytes = (start*typesize) - * int start_blosc = start_bytes // encoding_size + /* "numcodecs/blosc.pyx":444 + * if typesize == 0: + * typesize = source[3] + * if encoding_size == 0: # <<<<<<<<<<<<<< + * encoding_size = typesize + * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_encoding_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_nbitems_blosc = __pyx_t_2; + if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":430 - * int nbitems_bytes = nitems * typesize - * int nbitems_blosc = nbitems_bytes // encoding_size - * int start_bytes = (start*typesize) # <<<<<<<<<<<<<< - * int start_blosc = start_bytes // encoding_size - * char *source_ptr + /* "numcodecs/blosc.pyx":445 + * typesize = source[3] + * if encoding_size == 0: + * encoding_size = typesize # <<<<<<<<<<<<<< + * + * # convert varibles to handle type and encoding syze */ - __pyx_t_3 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_start_bytes = __pyx_t_2; + __Pyx_INCREF(__pyx_v_typesize); + __Pyx_DECREF_SET(__pyx_v_encoding_size, __pyx_v_typesize); - /* "numcodecs/blosc.pyx":431 - * int nbitems_blosc = nbitems_bytes // encoding_size - * int start_bytes = (start*typesize) - * int start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< - * char *source_ptr - * char *dest_ptr + /* "numcodecs/blosc.pyx":444 + * if typesize == 0: + * typesize = source[3] + * if encoding_size == 0: # <<<<<<<<<<<<<< + * encoding_size = typesize + * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_3, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + } + + /* "numcodecs/blosc.pyx":448 + * + * # convert varibles to handle type and encoding syze + * nitems_bytes = nitems * typesize # <<<<<<<<<<<<<< + * nitems_blosc = nitems_bytes // encoding_size + * start_bytes = (start * typesize) + */ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_start_blosc = __pyx_t_2; + __pyx_v_nitems_bytes = __pyx_t_5; - /* "numcodecs/blosc.pyx":435 - * char *dest_ptr - * Buffer source_buffer - * Buffer dest_buffer = None # <<<<<<<<<<<<<< - * size_t nbytes, cbytes, blocksize + /* "numcodecs/blosc.pyx":449 + * # convert varibles to handle type and encoding syze + * nitems_bytes = nitems * typesize + * nitems_blosc = nitems_bytes // encoding_size # <<<<<<<<<<<<<< + * start_bytes = (start * typesize) + * start_blosc = start_bytes // encoding_size + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nitems_blosc = __pyx_t_5; + + /* "numcodecs/blosc.pyx":450 + * nitems_bytes = nitems * typesize + * nitems_blosc = nitems_bytes // encoding_size + * start_bytes = (start * typesize) # <<<<<<<<<<<<<< + * start_blosc = start_bytes // encoding_size * */ - __Pyx_INCREF(Py_None); - __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); + __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start_bytes = __pyx_t_5; - /* "numcodecs/blosc.pyx":438 - * size_t nbytes, cbytes, blocksize + /* "numcodecs/blosc.pyx":451 + * nitems_blosc = nitems_bytes // encoding_size + * start_bytes = (start * typesize) + * start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< + * + * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_2, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_start_blosc = __pyx_t_5; + + /* "numcodecs/blosc.pyx":453 + * start_blosc = start_bytes // encoding_size * - * assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< + * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 438, __pyx_L1_error) + __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, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_the_encoding_size_is_not_a_divis); - __PYX_ERR(0, 438, __pyx_L1_error) + __PYX_ERR(0, 453, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":439 + /* "numcodecs/blosc.pyx":454 * - * assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" + * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) # <<<<<<<<<<<<<< * - * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) + * # setup destination buffer */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 439, __pyx_L1_error) + __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, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Remainder(__pyx_t_6, __pyx_v_encoding_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_2 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); + __pyx_t_8 = PyNumber_Remainder(__pyx_t_7, __pyx_v_encoding_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(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_3, function); - __pyx_t_2 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_v_encoding_size, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_v_encoding_size, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_v_encoding_size); __Pyx_GIVEREF(__pyx_v_encoding_size); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_v_encoding_size); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_2, __pyx_t_7); - __pyx_t_5 = 0; - __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_encoding_size); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, __pyx_t_8); + __pyx_t_6 = 0; + __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - PyErr_SetObject(PyExc_AssertionError, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 439, __pyx_L1_error) + PyErr_SetObject(PyExc_AssertionError, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 454, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":441 - * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) - * - * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) # <<<<<<<<<<<<<< - * source_ptr = source_buffer.ptr - * - */ - __pyx_t_3 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_source); - __Pyx_GIVEREF(__pyx_v_source); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_source_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "numcodecs/blosc.pyx":442 - * - * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) - * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< - * - * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) - */ - __pyx_t_9 = __pyx_v_source_buffer->ptr; - __pyx_v_source_ptr = __pyx_t_9; - - /* "numcodecs/blosc.pyx":444 - * source_ptr = source_buffer.ptr - * - * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) # <<<<<<<<<<<<<< - * - * if dest is None: - */ - blosc_cbuffer_sizes(__pyx_v_source_ptr, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize)); - - /* "numcodecs/blosc.pyx":446 - * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + /* "numcodecs/blosc.pyx":457 * + * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< - * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ __pyx_t_4 = (__pyx_v_dest == Py_None); __pyx_t_10 = (__pyx_t_4 != 0); if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":447 - * + /* "numcodecs/blosc.pyx":458 + * # setup destination buffer * if dest is None: - * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) # <<<<<<<<<<<<<< + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) # <<<<<<<<<<<<<< * dest_ptr = PyBytes_AS_STRING(dest) - * dest_nbytes = nbitems_bytes + * dest_nbytes = nitems_bytes */ - __pyx_t_3 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbitems_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_2); + __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":448 + /* "numcodecs/blosc.pyx":459 * if dest is None: - * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< - * dest_nbytes = nbitems_bytes + * dest_nbytes = nitems_bytes * else: */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":449 - * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) + /* "numcodecs/blosc.pyx":460 + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) - * dest_nbytes = nbitems_bytes # <<<<<<<<<<<<<< + * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< * else: * arr = ensure_contiguous_ndarray(dest) */ - __pyx_v_dest_nbytes = __pyx_v_nbitems_bytes; + __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; - /* "numcodecs/blosc.pyx":446 - * blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + /* "numcodecs/blosc.pyx":457 * + * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< - * dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) + * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ - goto __pyx_L3; + goto __pyx_L5; } - /* "numcodecs/blosc.pyx":451 - * dest_nbytes = nbitems_bytes + /* "numcodecs/blosc.pyx":462 + * 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_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = NULL; + __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_8)) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dest); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dest); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_arr = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":452 + /* "numcodecs/blosc.pyx":463 * 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_3 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_3)); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_2)); + __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":453 + /* "numcodecs/blosc.pyx":464 * 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: + * */ - __pyx_t_9 = __pyx_v_dest_buffer->ptr; - __pyx_v_dest_ptr = __pyx_t_9; + __pyx_t_3 = __pyx_v_dest_buffer->ptr; + __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":454 + /* "numcodecs/blosc.pyx":465 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< - * try: * + * # try decompression */ __pyx_t_11 = __pyx_v_dest_buffer->nbytes; __pyx_v_dest_nbytes = __pyx_t_11; } - __pyx_L3:; + __pyx_L5:; - /* "numcodecs/blosc.pyx":455 - * dest_ptr = dest_buffer.ptr - * dest_nbytes = dest_buffer.nbytes - * try: # <<<<<<<<<<<<<< + /* "numcodecs/blosc.pyx":468 * - * if dest_nbytes < nbitems_bytes: + * # try decompression + * try: # <<<<<<<<<<<<<< + * if dest_nbytes < nitems_blosc: + * raise ValueError('destination buffer too small; expected at least %s, ' */ /*try:*/ { - /* "numcodecs/blosc.pyx":457 + /* "numcodecs/blosc.pyx":469 + * # try decompression * try: - * - * if dest_nbytes < nbitems_bytes: # <<<<<<<<<<<<<< + * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems, dest_nbytes)) + * 'got %s' % (nitems_blosc, dest_nbytes)) */ - __pyx_t_10 = ((__pyx_v_dest_nbytes < __pyx_v_nbitems_bytes) != 0); + __pyx_t_10 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_blosc) != 0); if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":458 - * - * if dest_nbytes < nbitems_bytes: + /* "numcodecs/blosc.pyx":470 + * try: + * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< - * 'got %s' % (nitems, dest_nbytes)) + * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = 0; __pyx_t_13 = 127; __Pyx_INCREF(__pyx_kp_u_destination_buffer_too_small_exp); __pyx_t_12 += 48; __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_destination_buffer_too_small_exp); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_destination_buffer_too_small_exp); - /* "numcodecs/blosc.pyx":459 - * if dest_nbytes < nbitems_bytes: + /* "numcodecs/blosc.pyx":471 + * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems, dest_nbytes)) # <<<<<<<<<<<<<< + * 'got %s' % (nitems_blosc, dest_nbytes)) # <<<<<<<<<<<<<< * - * ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) + * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) */ - __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_nitems), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_13; __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_got); __pyx_t_12 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_got); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L5_error) + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_got); + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":458 - * - * if dest_nbytes < nbitems_bytes: + /* "numcodecs/blosc.pyx":470 + * try: + * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< - * 'got %s' % (nitems, dest_nbytes)) + * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 458, __pyx_L5_error) + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 470, __pyx_L7_error) - /* "numcodecs/blosc.pyx":457 + /* "numcodecs/blosc.pyx":469 + * # try decompression * try: - * - * if dest_nbytes < nbitems_bytes: # <<<<<<<<<<<<<< + * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems, dest_nbytes)) + * 'got %s' % (nitems_blosc, dest_nbytes)) */ } - /* "numcodecs/blosc.pyx":461 - * 'got %s' % (nitems, dest_nbytes)) + /* "numcodecs/blosc.pyx":473 + * 'got %s' % (nitems_blosc, dest_nbytes)) * - * ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) # <<<<<<<<<<<<<< + * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) # <<<<<<<<<<<<<< * * finally: */ - __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nbitems_blosc, __pyx_v_dest_ptr); + __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nitems_blosc, __pyx_v_dest_ptr); } - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":476 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5280,11 +5325,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*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, 464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":477 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5295,18 +5340,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_4 = (__pyx_t_10 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":478 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * - * if ret <= 0: + * # ret refers to the number of bytes returned from blosc_getitem. */ - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":477 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5314,19 +5359,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * */ } - goto __pyx_L6; + goto __pyx_L8; } - __pyx_L5_error:; + __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); @@ -5335,21 +5380,21 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); - __pyx_t_2 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; + __pyx_t_5 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":476 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< * if dest_buffer is not None: * dest_buffer.release() */ - __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, 464, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":477 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5360,18 +5405,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_10 = (__pyx_t_4 != 0); if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":478 * source_buffer.release() * if dest_buffer is not None: * dest_buffer.release() # <<<<<<<<<<<<<< * - * if ret <= 0: + * # ret refers to the number of bytes returned from blosc_getitem. */ - __pyx_t_3 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":477 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5391,9 +5436,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; - __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L1_error; - __pyx_L10_error:; + __pyx_L12_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); @@ -5406,82 +5451,54 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; goto __pyx_L1_error; } - __pyx_L6:; + __pyx_L8:; } - /* "numcodecs/blosc.pyx":468 - * dest_buffer.release() + /* "numcodecs/blosc.pyx":481 * + * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< - * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + * raise RuntimeError('error during blosc partial decompression: %d', ret) * */ __pyx_t_10 = ((__pyx_v_ret <= 0) != 0); if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":469 - * + /* "numcodecs/blosc.pyx":482 + * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: - * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) # <<<<<<<<<<<<<< + * raise RuntimeError('error during blosc partial decompression: %d', ret) # <<<<<<<<<<<<<< * * return dest */ - __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = 0; - __pyx_t_13 = 127; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_kp_u_error_during_blosc_partial_decom); - __pyx_t_12 += 42; __Pyx_GIVEREF(__pyx_kp_u_error_during_blosc_partial_decom); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_error_during_blosc_partial_decom); - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_ret, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_INCREF(__pyx_kp_u_start_2); - __pyx_t_12 += 9; - __Pyx_GIVEREF(__pyx_kp_u_start_2); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_start_2); - __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_start, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_13; - __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_INCREF(__pyx_kp_u_nbytes); - __pyx_t_12 += 10; - __Pyx_GIVEREF(__pyx_kp_u_nbytes); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_nbytes); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_error_during_blosc_partial_decom); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 482, __pyx_L1_error) - /* "numcodecs/blosc.pyx":468 - * dest_buffer.release() + /* "numcodecs/blosc.pyx":481 * + * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< - * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + * raise RuntimeError('error during blosc partial decompression: %d', ret) * */ } - /* "numcodecs/blosc.pyx":471 - * raise RuntimeError('error during blosc partial decompression: %d, start: %d, nbytes: %d' % (ret, start, nbytes)) + /* "numcodecs/blosc.pyx":484 + * raise RuntimeError('error during blosc partial decompression: %d', ret) * * return dest # <<<<<<<<<<<<<< * @@ -5495,7 +5512,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ @@ -5503,24 +5520,26 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __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_typesize); + __Pyx_XDECREF(__pyx_v_encoding_size); __Pyx_XDECREF(__pyx_v_dest); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "numcodecs/blosc.pyx":479 +/* "numcodecs/blosc.pyx":492 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5556,16 +5575,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":494 * 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, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __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, 481, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5580,27 +5599,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 481, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __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":484 + /* "numcodecs/blosc.pyx":497 * * # 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, 484, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __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, 484, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 497, __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":485 + /* "numcodecs/blosc.pyx":498 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5612,7 +5631,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":484 + /* "numcodecs/blosc.pyx":497 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5621,25 +5640,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":488 + /* "numcodecs/blosc.pyx":501 * * # 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, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __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, 488, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __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, 488, __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, 501, __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, 488, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":492 + /* "numcodecs/blosc.pyx":505 * # 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 # <<<<<<<<<<<<<< @@ -5651,7 +5670,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":488 + /* "numcodecs/blosc.pyx":501 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5660,25 +5679,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":494 + /* "numcodecs/blosc.pyx":507 * 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, 494, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __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, 494, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 494, __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, 507, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 507, __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, 494, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 494, __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, 507, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -5686,19 +5705,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":496 + /* "numcodecs/blosc.pyx":509 * 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, 496, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":494 + /* "numcodecs/blosc.pyx":507 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5708,7 +5727,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":505 + /* "numcodecs/blosc.pyx":518 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5716,13 +5735,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 505, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __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, 505, __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, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":506 + /* "numcodecs/blosc.pyx":519 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5732,7 +5751,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":505 + /* "numcodecs/blosc.pyx":518 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5742,30 +5761,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":507 + /* "numcodecs/blosc.pyx":520 * 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, 507, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __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, 507, __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, 520, __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":508 + /* "numcodecs/blosc.pyx":521 * _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, 508, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __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, 508, __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, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5780,12 +5799,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 508, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __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, 508, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __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, 508, __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, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5800,16 +5819,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 508, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __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, 508, __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, 521, __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":507 + /* "numcodecs/blosc.pyx":520 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5819,7 +5838,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":510 + /* "numcodecs/blosc.pyx":523 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5827,9 +5846,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 510, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __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, 510, __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, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5844,13 +5863,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 510, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __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, 510, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __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, 510, __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, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -5859,7 +5878,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":512 + /* "numcodecs/blosc.pyx":525 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5871,7 +5890,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":492 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5895,7 +5914,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":549 +/* "numcodecs/blosc.pyx":562 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5910,7 +5929,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 549, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5924,7 +5943,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 549, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -6017,7 +6036,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, 549, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6042,7 +6061,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, 549, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 562, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6065,16 +6084,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":550 + /* "numcodecs/blosc.pyx":563 * * 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, 550, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 563, __pyx_L1_error) - /* "numcodecs/blosc.pyx":551 + /* "numcodecs/blosc.pyx":564 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6085,14 +6104,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":552 + /* "numcodecs/blosc.pyx":565 * 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, 552, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -6106,13 +6125,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, 552, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __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, 552, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":551 + /* "numcodecs/blosc.pyx":564 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6122,7 +6141,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":554 + /* "numcodecs/blosc.pyx":567 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -6130,38 +6149,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, 554, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 567, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":555 + /* "numcodecs/blosc.pyx":568 * 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, 555, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 568, __pyx_L1_error) - /* "numcodecs/blosc.pyx":556 + /* "numcodecs/blosc.pyx":569 * 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, 556, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - /* "numcodecs/blosc.pyx":557 + /* "numcodecs/blosc.pyx":570 * 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, 557, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 570, __pyx_L1_error) - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":562 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -6184,7 +6203,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":559 +/* "numcodecs/blosc.pyx":572 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6225,11 +6244,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, 559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 572, __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, 559, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 572, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6242,7 +6261,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, 559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 572, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6270,16 +6289,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":560 + /* "numcodecs/blosc.pyx":573 * * 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, 560, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __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, 560, __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, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6296,7 +6315,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, 560, __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, 573, __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; @@ -6305,14 +6324,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, 560, __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, 573, __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, 560, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 573, __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; @@ -6323,7 +6342,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, 560, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6331,7 +6350,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":561 + /* "numcodecs/blosc.pyx":574 * 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) # <<<<<<<<<<<<<< @@ -6339,15 +6358,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, 561, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __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, 561, __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, 574, __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, 561, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __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, 561, __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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -6364,7 +6383,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, 561, __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, 574, __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; @@ -6376,7 +6395,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, 561, __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, 574, __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; @@ -6386,7 +6405,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, 561, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __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; @@ -6406,7 +6425,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, 561, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6415,7 +6434,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":572 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6442,7 +6461,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":563 +/* "numcodecs/blosc.pyx":576 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6487,7 +6506,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, 563, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 576, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6497,7 +6516,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, 563, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 576, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6515,7 +6534,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, 563, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6540,16 +6559,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":564 + /* "numcodecs/blosc.pyx":577 * * 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, 564, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __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, 564, __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, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6566,7 +6585,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, 564, __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, 577, __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; @@ -6575,14 +6594,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, 564, __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, 577, __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, 564, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __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; @@ -6593,7 +6612,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, 564, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6601,15 +6620,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":565 + /* "numcodecs/blosc.pyx":578 * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -6626,7 +6645,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, 565, __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, 578, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6634,13 +6653,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, 565, __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, 578, __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, 565, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __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; @@ -6651,7 +6670,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, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -6660,7 +6679,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":576 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6684,17 +6703,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":567 +/* "numcodecs/blosc.pyx":580 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ /* 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, int typesize, int encoding_size, out=None)"; +static char __pyx_doc_9numcodecs_5blosc_5Blosc_6decode_partial[] = "Blosc.decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None)"; 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; @@ -6741,31 +6760,31 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 1); __PYX_ERR(0, 567, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 1); __PYX_ERR(0, 580, __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, 6, 7, 2); __PYX_ERR(0, 567, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 2); __PYX_ERR(0, 580, __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, 6, 7, 3); __PYX_ERR(0, 567, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 3); __PYX_ERR(0, 580, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 4); __PYX_ERR(0, 567, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize); + if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, 5); __PYX_ERR(0, 567, __pyx_L3_error) + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size); + if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: @@ -6775,15 +6794,17 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 567, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + 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); @@ -6793,15 +6814,23 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 567, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) - __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + if (values[4]) { + __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + } else { + __pyx_v_typesize = ((int)((int)0)); + } + if (values[5]) { + __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + } else { + __pyx_v_encoding_size = ((int)((int)0)); + } __pyx_v_out = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 567, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6827,16 +6856,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":568 + /* "numcodecs/blosc.pyx":581 * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __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, 568, __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, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6853,7 +6882,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 568, __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, 581, __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; @@ -6862,14 +6891,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 568, __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, 581, __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, 568, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __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; @@ -6880,7 +6909,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6888,41 +6917,41 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":569 - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + /* "numcodecs/blosc.pyx":582 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< * typesize, encoding_size, dest=out) * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __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, 569, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __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, 569, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "numcodecs/blosc.pyx":570 + /* "numcodecs/blosc.pyx":583 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "numcodecs/blosc.pyx":569 - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + /* "numcodecs/blosc.pyx":582 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< * typesize, encoding_size, dest=out) * */ - __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); @@ -6940,25 +6969,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __pyx_t_3 = 0; __pyx_t_4 = 0; - /* "numcodecs/blosc.pyx":570 + /* "numcodecs/blosc.pyx":583 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 570, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 583, __pyx_L1_error) - /* "numcodecs/blosc.pyx":569 - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): + /* "numcodecs/blosc.pyx":582 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< * typesize, encoding_size, dest=out) * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6967,10 +6996,10 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __pyx_t_3 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":580 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ @@ -6992,7 +7021,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":572 +/* "numcodecs/blosc.pyx":585 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7027,28 +7056,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":573 + /* "numcodecs/blosc.pyx":586 * * 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, 573, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":574 + /* "numcodecs/blosc.pyx":587 * 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, 574, __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, 587, __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, 574, __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, 587, __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; @@ -7061,16 +7090,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":575 + /* "numcodecs/blosc.pyx":588 * 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, 575, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __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, 575, __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, 588, __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; @@ -7083,16 +7112,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":576 + /* "numcodecs/blosc.pyx":589 * (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, 576, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __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, 576, __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, 589, __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; @@ -7105,25 +7134,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":577 + /* "numcodecs/blosc.pyx":590 * 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, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __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, 577, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __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, 577, __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, 590, __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, 577, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __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, 577, __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, 590, __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; @@ -7136,15 +7165,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":578 + /* "numcodecs/blosc.pyx":591 * 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, 578, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __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, 578, __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, 591, __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; @@ -7157,20 +7186,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":573 + /* "numcodecs/blosc.pyx":586 * * 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, 573, __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, 586, __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":579 + /* "numcodecs/blosc.pyx":592 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -7180,7 +7209,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":585 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7310,7 +7339,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_compressor_set, __pyx_k_compressor_set, sizeof(__pyx_k_compressor_set), 0, 0, 1, 1}, {&__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_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 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}, @@ -7357,11 +7385,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_mutex, __pyx_k_mutex, sizeof(__pyx_k_mutex), 0, 0, 1, 1}, {&__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_nbitems_blosc, __pyx_k_nbitems_blosc, sizeof(__pyx_k_nbitems_blosc), 0, 0, 1, 1}, - {&__pyx_n_s_nbitems_bytes, __pyx_k_nbitems_bytes, sizeof(__pyx_k_nbitems_bytes), 0, 0, 1, 1}, - {&__pyx_kp_u_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 1, 0, 0}, - {&__pyx_n_s_nbytes_2, __pyx_k_nbytes_2, sizeof(__pyx_k_nbytes_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_blosc, __pyx_k_nitems_blosc, sizeof(__pyx_k_nitems_blosc), 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}, @@ -7386,7 +7413,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_kp_u_start_2, __pyx_k_start_2, sizeof(__pyx_k_start_2), 0, 1, 0, 0}, {&__pyx_n_s_start_blosc, __pyx_k_start_blosc, sizeof(__pyx_k_start_blosc), 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}, @@ -7493,7 +7519,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """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_2, __pyx_n_s_cbytes, __pyx_n_s_blocksize); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 125, __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, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 125, __pyx_L1_error) @@ -7541,7 +7567,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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_2, __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_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, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 215, __pyx_L1_error) @@ -7553,7 +7579,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """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_2, __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_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, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 323, __pyx_L1_error) @@ -7561,92 +7587,89 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ - __pyx_tuple__27 = PyTuple_Pack(20, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nbitems_bytes, __pyx_n_s_nbitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __pyx_n_s_source_ptr, __pyx_n_s_dest_ptr, __pyx_n_s_source_buffer, __pyx_n_s_dest_buffer, __pyx_n_s_nbytes_2, __pyx_n_s_cbytes, __pyx_n_s_blocksize, __pyx_n_s_dest_nbytes, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nitems_bytes, __pyx_n_s_nitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __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(6, 0, 20, 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) + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 17, 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":479 + /* "numcodecs/blosc.pyx":492 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 479, __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, 492, __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, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 479, __pyx_L1_error) + __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, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 492, __pyx_L1_error) - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":562 * 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__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, 549, __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, 562, __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, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 549, __pyx_L1_error) + __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, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 562, __pyx_L1_error) - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":572 * 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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 559, __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, 572, __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, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 559, __pyx_L1_error) + __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, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 572, __pyx_L1_error) - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":576 * 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__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_out); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 563, __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, 576, __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, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 563, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 563, __pyx_L1_error) + __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, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":580 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 567, __pyx_L1_error) - __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 567, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 580, __pyx_L1_error) - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":585 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 572, __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, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7853,6 +7876,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_blosc(PyObject *__pyx_pyinit_modul PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -8519,7 +8543,7 @@ if (!__Pyx_RefNanny) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< * """Decompress data. * */ @@ -8528,35 +8552,35 @@ if (!__Pyx_RefNanny) { 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":476 + /* "numcodecs/blosc.pyx":489 * # 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, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 489, __pyx_L1_error) - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":492 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 479, __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, 492, __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, 479, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":515 + /* "numcodecs/blosc.pyx":528 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -8570,38 +8594,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, 515, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":518 + /* "numcodecs/blosc.pyx":531 * * * 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, 518, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __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, 518, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __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, 518, __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, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":542 + /* "numcodecs/blosc.pyx":555 * """ * * 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, 542, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - /* "numcodecs/blosc.pyx":543 + /* "numcodecs/blosc.pyx":556 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8609,12 +8633,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) + 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_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":544 + /* "numcodecs/blosc.pyx":557 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8622,12 +8646,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 557, __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, 544, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":545 + /* "numcodecs/blosc.pyx":558 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8635,12 +8659,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, 545, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 558, __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, 545, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":546 + /* "numcodecs/blosc.pyx":559 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8648,110 +8672,126 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __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, 546, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":547 + /* "numcodecs/blosc.pyx":560 * 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, 547, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 560, __pyx_L1_error) - /* "numcodecs/blosc.pyx":549 + /* "numcodecs/blosc.pyx":562 * 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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 549, __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, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 549, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 562, __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, 549, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __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, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 549, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":572 * 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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __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, 572, __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, 559, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":576 * 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__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __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, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 563, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":580 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize, int encoding_size, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __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, 567, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __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, 567, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)Py_None)); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __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_9)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_9) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":585 * typesize, encoding_size, 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_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, 572, __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, 572, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __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__41)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_9) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "numcodecs/blosc.pyx":518 + /* "numcodecs/blosc.pyx":531 * * * 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, 518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 518, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_9) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8775,6 +8815,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init numcodecs.blosc", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -10036,6 +10077,93 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, PyObject_RichCompare(op1, op2, Py_EQ)); } +/* 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)); +} + /* CIntToPyUnicode */ #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ @@ -10125,42 +10253,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t wi return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } -/* PyObjectFormat */ -#if CYTHON_USE_UNICODE_WRITER -static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { - int ret; - _PyUnicodeWriter writer; - if (likely(PyFloat_CheckExact(obj))) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 - _PyUnicodeWriter_Init(&writer, 0); -#else - _PyUnicodeWriter_Init(&writer); -#endif - ret = _PyFloat_FormatAdvancedWriter( - &writer, - obj, - format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); - } else if (likely(PyLong_CheckExact(obj))) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000 - _PyUnicodeWriter_Init(&writer, 0); -#else - _PyUnicodeWriter_Init(&writer); -#endif - ret = _PyLong_FormatAdvancedWriter( - &writer, - obj, - format_spec, 0, PyUnicode_GET_LENGTH(format_spec)); - } else { - return PyObject_Format(obj, format_spec); - } - if (unlikely(ret == -1)) { - _PyUnicodeWriter_Dealloc(&writer); - return NULL; - } - return _PyUnicodeWriter_Finish(&writer); -} -#endif - /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY @@ -10479,93 +10571,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) { @@ -11781,6 +11786,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; @@ -11970,37 +12006,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 efa5993a..5f63902e 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -394,7 +394,7 @@ def decompress(source, dest=None): return dest -def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None): +def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): """Decompress data. Parameters @@ -405,9 +405,9 @@ def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None dest : array-like, optional Object to decompress into. start: int, - Offset in inem where we want to start decoding + Offset in item where we want to start decoding nitems: int - Number of item we want to decode + Number of items we want to decode typesize: int Size in number of bytes of the type we want to decode. encoding_size: int @@ -425,48 +425,63 @@ def decompress_partial(source, start, nitems, typesize, encoding_size, dest=None cdef: int ret - int nbitems_bytes = nitems * typesize - int nbitems_blosc = nbitems_bytes // encoding_size - int start_bytes = (start*typesize) - int start_blosc = start_bytes // encoding_size + int nitems_bytes + int nitems_blosc + int start_bytes + int start_blosc char *source_ptr char *dest_ptr Buffer source_buffer Buffer dest_buffer = None - size_t nbytes, cbytes, blocksize - assert nbitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" - assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) - + # setup source buffer source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) source_ptr = source_buffer.ptr - blosc_cbuffer_sizes(source_ptr, &nbytes, &cbytes, &blocksize) + # determine typesize if not given + if typesize == 0: + typesize = source[3] + # infers encoding size from typesize if not given. Could be wrong if + # array is converted before encoding. + if encoding_size == 0: + encoding_size = typesize + + # convert varibles to handle type and encoding sizes + nitems_bytes = nitems * typesize + nitems_blosc = nitems_bytes // encoding_size + start_bytes = (start * typesize) + start_blosc = start_bytes // encoding_size + + assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" + assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) + # setup destination buffer if dest is None: - dest = PyBytes_FromStringAndSize(NULL, nbitems_bytes) + dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) dest_ptr = PyBytes_AS_STRING(dest) - dest_nbytes = nbitems_bytes + 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 < nbitems_bytes: + if dest_nbytes < nitems_blosc: raise ValueError('destination buffer too small; expected at least %s, ' - 'got %s' % (nitems, dest_nbytes)) + 'got %s' % (nitems_blosc, dest_nbytes)) - ret = blosc_getitem(source_ptr, start_blosc, nbitems_blosc, dest_ptr) + ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, 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, start: %d, nbytes: %d' % (ret, start, nbytes)) + raise RuntimeError('error during blosc partial decompression: %d', ret) return dest @@ -564,7 +579,7 @@ 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, int typesize, int encoding_size, out=None): + def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress_partial(buf, start, nitems, typesize, encoding_size, dest=out) diff --git a/numcodecs/lz4.c b/numcodecs/lz4.c index 319e191c..01cb5a3e 100644 --- a/numcodecs/lz4.c +++ b/numcodecs/lz4.c @@ -827,7 +827,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/lz4.pyx", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index 39693af4..7171afc2 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -31,8 +31,6 @@ def compare_arrays(arr, res, precision=None): order = 'F' else: order = 'C' - print(arr.shape) - print(res.shape) res = res.reshape(arr.shape, order=order) # exact compare @@ -129,7 +127,7 @@ def check_encode_decode_partial(arr, codec, precision=None): compare_arr = arr[start:start+nitems] # test encoding of numpy array enc = codec.encode(arr) - dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, ITEMSIZE) + dec = codec.decode_partial(enc, start, nitems) compare_arrays(compare_arr, dec, precision=precision) # test encoding of bytes diff --git a/numcodecs/vlen.c b/numcodecs/vlen.c index 4a1fb4c1..70de9664 100644 --- a/numcodecs/vlen.c +++ b/numcodecs/vlen.c @@ -827,9 +827,9 @@ static const char *__pyx_f[] = { "numcodecs/vlen.pyx", "stringsource", "numcodecs/compat_ext.pxd", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/bool.pxd", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/complex.pxd", + ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/bool.pxd", + ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/complex.pxd", }; /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; diff --git a/numcodecs/zstd.c b/numcodecs/zstd.c index 26601564..38793995 100644 --- a/numcodecs/zstd.c +++ b/numcodecs/zstd.c @@ -857,7 +857,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/zstd.pyx", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ From f5b390288c425c874759464359f93dc6903a70bb Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Fri, 22 May 2020 10:19:19 -0600 Subject: [PATCH 08/20] removes unused import --- numcodecs/tests/test_blosc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index c31193b9..5a7aa7a7 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -1,7 +1,6 @@ import itertools from multiprocessing import Pool from multiprocessing.pool import ThreadPool -import logging import numpy as np From be3b07467349dfedbfc39585810c18bb991845b1 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Tue, 26 May 2020 14:50:57 -0700 Subject: [PATCH 09/20] Example of unstable-allowing context manager. The advantage of using warnings instead of globals is performance and the ability to also still get the warning printed by default. --- numcodecs/blosc.pyx | 3 +++ numcodecs/tests/test_blosc.py | 6 +++++- numcodecs/utils.py | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 numcodecs/utils.py diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 5f63902e..7d1f6bfb 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -17,6 +17,8 @@ from .compat_ext import Buffer from .compat import ensure_contiguous_ndarray from .abc import Codec +from .utils import unstable + cdef extern from "blosc.h": cdef enum: @@ -580,6 +582,7 @@ class Blosc(Codec): return decompress(buf, out) def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + unstable() buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress_partial(buf, start, nitems, typesize, encoding_size, dest=out) diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index 5a7aa7a7..fbbed03d 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -65,7 +65,11 @@ def test_encode_decode(): else pytest.param(x, marks=[pytest.mark.xfail]) for x in arrays]) def test_partial_decode(codec, array): - check_encode_decode_partial(array, codec) + + + from numcodecs.utils import allow_unstable + with allow_unstable(): + check_encode_decode_partial(array, codec) def test_config(): diff --git a/numcodecs/utils.py b/numcodecs/utils.py new file mode 100644 index 00000000..c784afc9 --- /dev/null +++ b/numcodecs/utils.py @@ -0,0 +1,36 @@ +from contextlib import contextmanager +import warnings + +class NumcodecsUnstableWarning(FutureWarning): + """ + Exception raise by an experimental feature in this numcodec + + Wrap code in :any:`allow_unstable` to let code dirrectly (or indirectly), + use unstable features. + """ + +warnings.filterwarnings('error', category=NumcodecsUnstableWarning) + +@contextmanager +def allow_unstable(action='default'): + """ + This context manager has to be used in any place where unstable completer + behavior and API may be called. + + >>> with allow_unstable(): + ... numcodecs.do_experimental_things() # works + + >>> numcodecs.do_experimental_things() # raises. + + """ + with warnings.catch_warnings(): + warnings.filterwarnings(action, category=NumcodecsUnstableWarning) + yield + + +def unstable(): + warnings.warn( + "You are (in)directly using an unstable feature, use the " + "``allow_unstable()`` context manager." + , category=NumcodecsUnstableWarning, stacklevel=2) + From 8678d6277e3e5916ab37046f088f88dbadbbd110 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Fri, 5 Jun 2020 11:41:48 -0600 Subject: [PATCH 10/20] removes unstable context manager --- numcodecs/blosc.pyx | 3 --- numcodecs/tests/test_blosc.py | 6 +----- numcodecs/utils.py | 36 ----------------------------------- 3 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 numcodecs/utils.py diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 7d1f6bfb..5f63902e 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -17,8 +17,6 @@ from .compat_ext import Buffer from .compat import ensure_contiguous_ndarray from .abc import Codec -from .utils import unstable - cdef extern from "blosc.h": cdef enum: @@ -582,7 +580,6 @@ class Blosc(Codec): return decompress(buf, out) def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): - unstable() buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress_partial(buf, start, nitems, typesize, encoding_size, dest=out) diff --git a/numcodecs/tests/test_blosc.py b/numcodecs/tests/test_blosc.py index fbbed03d..5a7aa7a7 100644 --- a/numcodecs/tests/test_blosc.py +++ b/numcodecs/tests/test_blosc.py @@ -65,11 +65,7 @@ def test_encode_decode(): else pytest.param(x, marks=[pytest.mark.xfail]) for x in arrays]) def test_partial_decode(codec, array): - - - from numcodecs.utils import allow_unstable - with allow_unstable(): - check_encode_decode_partial(array, codec) + check_encode_decode_partial(array, codec) def test_config(): diff --git a/numcodecs/utils.py b/numcodecs/utils.py deleted file mode 100644 index c784afc9..00000000 --- a/numcodecs/utils.py +++ /dev/null @@ -1,36 +0,0 @@ -from contextlib import contextmanager -import warnings - -class NumcodecsUnstableWarning(FutureWarning): - """ - Exception raise by an experimental feature in this numcodec - - Wrap code in :any:`allow_unstable` to let code dirrectly (or indirectly), - use unstable features. - """ - -warnings.filterwarnings('error', category=NumcodecsUnstableWarning) - -@contextmanager -def allow_unstable(action='default'): - """ - This context manager has to be used in any place where unstable completer - behavior and API may be called. - - >>> with allow_unstable(): - ... numcodecs.do_experimental_things() # works - - >>> numcodecs.do_experimental_things() # raises. - - """ - with warnings.catch_warnings(): - warnings.filterwarnings(action, category=NumcodecsUnstableWarning) - yield - - -def unstable(): - warnings.warn( - "You are (in)directly using an unstable feature, use the " - "``allow_unstable()`` context manager." - , category=NumcodecsUnstableWarning, stacklevel=2) - From d03da9f61f381768be60f970b2cbf99fb1a4eed4 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Fri, 5 Jun 2020 11:44:17 -0600 Subject: [PATCH 11/20] adds experimental docstrings --- numcodecs/blosc.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 5f63902e..d9e2c88b 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -395,7 +395,8 @@ def decompress(source, dest=None): def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): - """Decompress data. + """**Experimental** + Decompress data of only a part of a buffer. Parameters ---------- @@ -576,6 +577,7 @@ class Blosc(Codec): return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) def decode(self, buf, out=None): + '''**Experimental**''' buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress(buf, out) From 49e89154a403dee1e091a1e73455f61151eb7b60 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Fri, 5 Jun 2020 12:09:16 -0600 Subject: [PATCH 12/20] updates cython c generated file --- numcodecs/blosc.c | 750 +++++++++++++++++++++++----------------------- 1 file changed, 375 insertions(+), 375 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index 0a507176..9cdda49e 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -912,7 +912,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/blosc.pyx", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py36/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ @@ -4654,13 +4654,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject * * * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< - * """Decompress data. - * + * """**Experimental** + * Decompress data of only a part of a buffer. */ /* Python wrapper */ 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, typesize=0, encoding_size=0, dest=None)\nDecompress data.\n\n Parameters\n ----------\n source : bytes-like\n Compressed data, including blosc header. Can be any object supporting the buffer\n protocol.\n dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\n \n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +static char __pyx_doc_9numcodecs_5blosc_24decompress_partial[] = "decompress_partial(source, start, nitems, typesize=0, encoding_size=0, 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 dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\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; @@ -4813,7 +4813,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_INCREF(__pyx_v_encoding_size); __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":435 + /* "numcodecs/blosc.pyx":436 * char *dest_ptr * Buffer source_buffer * Buffer dest_buffer = None # <<<<<<<<<<<<<< @@ -4823,16 +4823,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_INCREF(Py_None); __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); - /* "numcodecs/blosc.pyx":438 + /* "numcodecs/blosc.pyx":439 * * # 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, 438, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -4840,147 +4840,147 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 438, __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, 439, __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":439 + /* "numcodecs/blosc.pyx":440 * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< * - * # determine encoding size and typesize if not given + * # determine typesize if not given */ __pyx_t_3 = __pyx_v_source_buffer->ptr; __pyx_v_source_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":442 + /* "numcodecs/blosc.pyx":443 * - * # determine encoding size and typesize if not given + * # determine typesize if not given * if typesize == 0: # <<<<<<<<<<<<<< * typesize = source[3] - * if encoding_size == 0: + * # infers encoding size from typesize if not given. Could be wrong if */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __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, 442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":443 - * # determine encoding size and typesize if not given + /* "numcodecs/blosc.pyx":444 + * # determine typesize if not given * if typesize == 0: * typesize = source[3] # <<<<<<<<<<<<<< - * if encoding_size == 0: - * encoding_size = typesize + * # infers encoding size from typesize if not given. Could be wrong if + * # array is converted before encoding. */ - __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, 443, __pyx_L1_error) + __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, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_typesize, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":442 + /* "numcodecs/blosc.pyx":443 * - * # determine encoding size and typesize if not given + * # determine typesize if not given * if typesize == 0: # <<<<<<<<<<<<<< * typesize = source[3] - * if encoding_size == 0: + * # infers encoding size from typesize if not given. Could be wrong if */ } - /* "numcodecs/blosc.pyx":444 - * if typesize == 0: - * typesize = source[3] + /* "numcodecs/blosc.pyx":447 + * # infers encoding size from typesize if not given. Could be wrong if + * # array is converted before encoding. * if encoding_size == 0: # <<<<<<<<<<<<<< * encoding_size = typesize * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_encoding_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_encoding_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __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, 444, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":445 - * typesize = source[3] + /* "numcodecs/blosc.pyx":448 + * # array is converted before encoding. * if encoding_size == 0: * encoding_size = typesize # <<<<<<<<<<<<<< * - * # convert varibles to handle type and encoding syze + * # convert varibles to handle type and encoding sizes */ __Pyx_INCREF(__pyx_v_typesize); __Pyx_DECREF_SET(__pyx_v_encoding_size, __pyx_v_typesize); - /* "numcodecs/blosc.pyx":444 - * if typesize == 0: - * typesize = source[3] + /* "numcodecs/blosc.pyx":447 + * # infers encoding size from typesize if not given. Could be wrong if + * # array is converted before encoding. * if encoding_size == 0: # <<<<<<<<<<<<<< * encoding_size = typesize * */ } - /* "numcodecs/blosc.pyx":448 + /* "numcodecs/blosc.pyx":451 * - * # convert varibles to handle type and encoding syze + * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * typesize # <<<<<<<<<<<<<< * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nitems_bytes = __pyx_t_5; - /* "numcodecs/blosc.pyx":449 - * # convert varibles to handle type and encoding syze + /* "numcodecs/blosc.pyx":452 + * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * typesize * nitems_blosc = nitems_bytes // encoding_size # <<<<<<<<<<<<<< * start_bytes = (start * typesize) * start_blosc = start_bytes // encoding_size */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_2 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nitems_blosc = __pyx_t_5; - /* "numcodecs/blosc.pyx":450 + /* "numcodecs/blosc.pyx":453 * nitems_bytes = nitems * typesize * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) # <<<<<<<<<<<<<< * start_blosc = start_bytes // encoding_size * */ - __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_start_bytes = __pyx_t_5; - /* "numcodecs/blosc.pyx":451 + /* "numcodecs/blosc.pyx":454 * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) * start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_2, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_2, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_start_blosc = __pyx_t_5; - /* "numcodecs/blosc.pyx":453 + /* "numcodecs/blosc.pyx":456 * start_blosc = start_bytes // encoding_size * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< @@ -4989,24 +4989,24 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_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, 453, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_the_encoding_size_is_not_a_divis); - __PYX_ERR(0, 453, __pyx_L1_error) + __PYX_ERR(0, 456, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":454 + /* "numcodecs/blosc.pyx":457 * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) # <<<<<<<<<<<<<< @@ -5015,24 +5015,24 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_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, 454, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Remainder(__pyx_t_7, __pyx_v_encoding_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_8 = PyNumber_Remainder(__pyx_t_7, __pyx_v_encoding_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -5050,7 +5050,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5060,7 +5060,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5068,7 +5068,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } else #endif { - __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -5082,22 +5082,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 454, __pyx_L1_error) + __PYX_ERR(0, 457, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":457 + /* "numcodecs/blosc.pyx":460 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -5108,19 +5108,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_10 = (__pyx_t_4 != 0); if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":458 + /* "numcodecs/blosc.pyx":461 * # 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_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":459 + /* "numcodecs/blosc.pyx":462 * if dest is None: * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -5129,7 +5129,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":460 + /* "numcodecs/blosc.pyx":463 * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< @@ -5138,7 +5138,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; - /* "numcodecs/blosc.pyx":457 + /* "numcodecs/blosc.pyx":460 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -5148,7 +5148,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P goto __pyx_L5; } - /* "numcodecs/blosc.pyx":462 + /* "numcodecs/blosc.pyx":465 * dest_nbytes = nitems_bytes * else: * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< @@ -5156,7 +5156,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * dest_ptr = dest_buffer.ptr */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -5170,22 +5170,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dest); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_arr = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":463 + /* "numcodecs/blosc.pyx":466 * 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_2 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -5193,13 +5193,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_2)); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":467 * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< @@ -5209,7 +5209,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_dest_buffer->ptr; __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":468 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< @@ -5221,7 +5221,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } __pyx_L5:; - /* "numcodecs/blosc.pyx":468 + /* "numcodecs/blosc.pyx":471 * * # try decompression * try: # <<<<<<<<<<<<<< @@ -5230,7 +5230,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*try:*/ { - /* "numcodecs/blosc.pyx":469 + /* "numcodecs/blosc.pyx":472 * # try decompression * try: * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< @@ -5240,14 +5240,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_10 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_blosc) != 0); if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":470 + /* "numcodecs/blosc.pyx":473 * try: * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L7_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = 0; __pyx_t_13 = 127; @@ -5256,14 +5256,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_destination_buffer_too_small_exp); - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":474 * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems_blosc, dest_nbytes)) # <<<<<<<<<<<<<< * * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) */ - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L7_error) + __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -5273,31 +5273,31 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_12 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_got); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L7_error) + __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":470 + /* "numcodecs/blosc.pyx":473 * try: * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L7_error) + __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 470, __pyx_L7_error) + __PYX_ERR(0, 473, __pyx_L7_error) - /* "numcodecs/blosc.pyx":469 + /* "numcodecs/blosc.pyx":472 * # try decompression * try: * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< @@ -5306,7 +5306,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":476 * 'got %s' % (nitems_blosc, dest_nbytes)) * * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) # <<<<<<<<<<<<<< @@ -5316,7 +5316,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nitems_blosc, __pyx_v_dest_ptr); } - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":479 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5325,11 +5325,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*finally:*/ { /*normal exit:*/{ - __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":480 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5340,18 +5340,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_4 = (__pyx_t_10 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":478 + /* "numcodecs/blosc.pyx":481 * 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_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":480 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5383,18 +5383,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_5 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":479 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< * if dest_buffer is not None: * dest_buffer.release() */ - __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L12_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":480 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5405,18 +5405,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_10 = (__pyx_t_4 != 0); if (__pyx_t_10) { - /* "numcodecs/blosc.pyx":478 + /* "numcodecs/blosc.pyx":481 * 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_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L12_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":477 + /* "numcodecs/blosc.pyx":480 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5454,7 +5454,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_L8:; } - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":484 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5464,16 +5464,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_10 = ((__pyx_v_ret <= 0) != 0); if (unlikely(__pyx_t_10)) { - /* "numcodecs/blosc.pyx":482 + /* "numcodecs/blosc.pyx":485 * # 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_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_kp_u_error_during_blosc_partial_decom); __Pyx_GIVEREF(__pyx_kp_u_error_during_blosc_partial_decom); @@ -5481,14 +5481,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 482, __pyx_L1_error) + __PYX_ERR(0, 485, __pyx_L1_error) - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":484 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5497,7 +5497,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":484 + /* "numcodecs/blosc.pyx":487 * raise RuntimeError('error during blosc partial decompression: %d', ret) * * return dest # <<<<<<<<<<<<<< @@ -5513,8 +5513,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * * * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< - * """Decompress data. - * + * """**Experimental** + * Decompress data of only a part of a buffer. */ /* function exit code */ @@ -5539,7 +5539,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P return __pyx_r; } -/* "numcodecs/blosc.pyx":492 +/* "numcodecs/blosc.pyx":495 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5575,16 +5575,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":494 + /* "numcodecs/blosc.pyx":497 * 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, 494, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __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, 494, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5599,27 +5599,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 494, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __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":497 + /* "numcodecs/blosc.pyx":500 * * # 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, 497, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __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, 497, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 500, __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":498 + /* "numcodecs/blosc.pyx":501 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5631,7 +5631,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":497 + /* "numcodecs/blosc.pyx":500 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5640,25 +5640,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":501 + /* "numcodecs/blosc.pyx":504 * * # 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, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __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, 501, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __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, 501, __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, 504, __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, 501, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":505 + /* "numcodecs/blosc.pyx":508 * # 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 # <<<<<<<<<<<<<< @@ -5670,7 +5670,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":501 + /* "numcodecs/blosc.pyx":504 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5679,25 +5679,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":507 + /* "numcodecs/blosc.pyx":510 * 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, 507, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __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, 507, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 507, __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, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 510, __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, 507, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 507, __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, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -5705,19 +5705,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":509 + /* "numcodecs/blosc.pyx":512 * 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, 509, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":507 + /* "numcodecs/blosc.pyx":510 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5727,7 +5727,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":518 + /* "numcodecs/blosc.pyx":521 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5735,13 +5735,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 518, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __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, 518, __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, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":519 + /* "numcodecs/blosc.pyx":522 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5751,7 +5751,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":518 + /* "numcodecs/blosc.pyx":521 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5761,30 +5761,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":520 + /* "numcodecs/blosc.pyx":523 * 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, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __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, 520, __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, 523, __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":521 + /* "numcodecs/blosc.pyx":524 * _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, 521, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __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, 521, __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, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5799,12 +5799,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 521, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __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, 521, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __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, 521, __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, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5819,16 +5819,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 521, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __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, 521, __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, 524, __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":520 + /* "numcodecs/blosc.pyx":523 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5838,7 +5838,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":523 + /* "numcodecs/blosc.pyx":526 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5846,9 +5846,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 523, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __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, 523, __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, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5863,13 +5863,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 523, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __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, 523, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __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, 523, __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, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -5878,7 +5878,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":525 + /* "numcodecs/blosc.pyx":528 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5890,7 +5890,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":492 + /* "numcodecs/blosc.pyx":495 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5914,7 +5914,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":562 +/* "numcodecs/blosc.pyx":565 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5929,7 +5929,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 562, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5943,7 +5943,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 562, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -6036,7 +6036,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, 562, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 565, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6061,7 +6061,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, 562, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6084,16 +6084,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":566 * * 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, 563, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - /* "numcodecs/blosc.pyx":564 + /* "numcodecs/blosc.pyx":567 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6104,14 +6104,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":565 + /* "numcodecs/blosc.pyx":568 * 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, 565, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -6125,13 +6125,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, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __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, 565, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":564 + /* "numcodecs/blosc.pyx":567 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6141,7 +6141,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":570 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -6149,38 +6149,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, 567, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 570, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":568 + /* "numcodecs/blosc.pyx":571 * 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, 568, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 571, __pyx_L1_error) - /* "numcodecs/blosc.pyx":569 + /* "numcodecs/blosc.pyx":572 * 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, 569, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - /* "numcodecs/blosc.pyx":570 + /* "numcodecs/blosc.pyx":573 * 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, 570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - /* "numcodecs/blosc.pyx":562 + /* "numcodecs/blosc.pyx":565 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -6203,7 +6203,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":572 +/* "numcodecs/blosc.pyx":575 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6244,11 +6244,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, 572, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 575, __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, 572, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 575, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6261,7 +6261,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, 572, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 575, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6289,16 +6289,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":573 + /* "numcodecs/blosc.pyx":576 * * 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, 573, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __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, 573, __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, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6315,7 +6315,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, 573, __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, 576, __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; @@ -6324,14 +6324,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, 573, __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, 576, __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, 573, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __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; @@ -6342,7 +6342,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, 573, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6350,7 +6350,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":574 + /* "numcodecs/blosc.pyx":577 * 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) # <<<<<<<<<<<<<< @@ -6358,15 +6358,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, 574, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __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, 574, __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, 577, __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, 574, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __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, 574, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __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, 574, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -6383,7 +6383,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, 574, __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, 577, __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; @@ -6395,7 +6395,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, 574, __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, 577, __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; @@ -6405,7 +6405,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, 574, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 577, __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; @@ -6425,7 +6425,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, 574, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6434,7 +6434,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":575 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6461,17 +6461,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":576 +/* "numcodecs/blosc.pyx":579 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) */ /* Python wrapper */ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_9numcodecs_5blosc_5Blosc_4decode[] = "Blosc.decode(self, buf, out=None)"; +static char __pyx_doc_9numcodecs_5blosc_5Blosc_4decode[] = "Blosc.decode(self, buf, out=None)\n**Experimental**"; static PyMethodDef __pyx_mdef_9numcodecs_5blosc_5Blosc_5decode = {"decode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9numcodecs_5blosc_5Blosc_5decode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9numcodecs_5blosc_5Blosc_4decode}; static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; @@ -6506,7 +6506,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, 576, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 579, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6516,7 +6516,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, 576, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 579, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6534,7 +6534,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, 576, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 579, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6559,16 +6559,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":577 - * + /* "numcodecs/blosc.pyx":581 * def decode(self, buf, out=None): + * '''**Experimental**''' * 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, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __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, 577, __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, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6585,7 +6585,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, 577, __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, 581, __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; @@ -6594,14 +6594,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, 577, __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, 581, __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, 577, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __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; @@ -6612,7 +6612,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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6620,15 +6620,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":578 - * def decode(self, buf, out=None): + /* "numcodecs/blosc.pyx":582 + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -6645,7 +6645,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, 578, __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, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6653,13 +6653,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, 578, __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, 582, __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, 578, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __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; @@ -6670,7 +6670,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, 578, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -6679,12 +6679,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":579 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) */ /* function exit code */ @@ -6703,7 +6703,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":580 +/* "numcodecs/blosc.pyx":584 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< @@ -6760,19 +6760,19 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p 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, 7, 1); __PYX_ERR(0, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 1); __PYX_ERR(0, 584, __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, 7, 2); __PYX_ERR(0, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 2); __PYX_ERR(0, 584, __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, 7, 3); __PYX_ERR(0, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, 3); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -6794,7 +6794,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6814,15 +6814,15 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 580, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) if (values[4]) { - __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } else { __pyx_v_typesize = ((int)((int)0)); } if (values[5]) { - __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) + __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } else { __pyx_v_encoding_size = ((int)((int)0)); } @@ -6830,7 +6830,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6856,16 +6856,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":581 + /* "numcodecs/blosc.pyx":585 * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __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, 581, __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, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6882,7 +6882,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 581, __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, 585, __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; @@ -6891,14 +6891,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 581, __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, 585, __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, 581, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __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; @@ -6909,7 +6909,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6917,7 +6917,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":582 + /* "numcodecs/blosc.pyx":586 * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< @@ -6925,33 +6925,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __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, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __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, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "numcodecs/blosc.pyx":583 + /* "numcodecs/blosc.pyx":587 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "numcodecs/blosc.pyx":582 + /* "numcodecs/blosc.pyx":586 * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< * typesize, encoding_size, dest=out) * */ - __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); @@ -6969,25 +6969,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __pyx_t_3 = 0; __pyx_t_4 = 0; - /* "numcodecs/blosc.pyx":583 + /* "numcodecs/blosc.pyx":587 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 587, __pyx_L1_error) - /* "numcodecs/blosc.pyx":582 + /* "numcodecs/blosc.pyx":586 * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< * typesize, encoding_size, dest=out) * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6996,7 +6996,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __pyx_t_3 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":584 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< @@ -7021,7 +7021,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":585 +/* "numcodecs/blosc.pyx":589 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7056,28 +7056,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":586 + /* "numcodecs/blosc.pyx":590 * * 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, 586, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":587 + /* "numcodecs/blosc.pyx":591 * 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, 587, __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, 591, __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, 587, __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, 591, __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; @@ -7090,16 +7090,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":588 + /* "numcodecs/blosc.pyx":592 * 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, 588, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __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, 588, __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, 592, __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; @@ -7112,16 +7112,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":589 + /* "numcodecs/blosc.pyx":593 * (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, 589, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __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, 589, __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, 593, __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; @@ -7134,25 +7134,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":590 + /* "numcodecs/blosc.pyx":594 * 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, 590, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __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, 590, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __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, 590, __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, 594, __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, 590, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __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, 590, __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, 594, __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; @@ -7165,15 +7165,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":591 + /* "numcodecs/blosc.pyx":595 * 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, 591, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 595, __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, 591, __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, 595, __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; @@ -7186,20 +7186,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":586 + /* "numcodecs/blosc.pyx":590 * * 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, 586, __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, 590, __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":592 + /* "numcodecs/blosc.pyx":596 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -7209,7 +7209,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":589 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7588,88 +7588,88 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< - * """Decompress data. - * + * """**Experimental** + * Decompress data of only a part of a buffer. */ __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nitems_bytes, __pyx_n_s_nitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __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(6, 0, 17, 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":492 + /* "numcodecs/blosc.pyx":495 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 492, __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, 495, __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, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 492, __pyx_L1_error) + __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, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 495, __pyx_L1_error) - /* "numcodecs/blosc.pyx":562 + /* "numcodecs/blosc.pyx":565 * 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__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, 562, __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, 565, __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, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 562, __pyx_L1_error) + __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, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 565, __pyx_L1_error) - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":575 * 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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 572, __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, 575, __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, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 572, __pyx_L1_error) + __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, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 575, __pyx_L1_error) - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":579 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress(buf, out) */ - __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, 576, __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, 579, __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, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 576, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 576, __pyx_L1_error) + __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, 579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":584 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 584, __pyx_L1_error) - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":589 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8544,43 +8544,43 @@ if (!__Pyx_RefNanny) { * * * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< - * """Decompress data. - * + * """**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_partial, __pyx_t_7) < 0) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":489 + /* "numcodecs/blosc.pyx":492 * # 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, 489, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 492, __pyx_L1_error) - /* "numcodecs/blosc.pyx":492 + /* "numcodecs/blosc.pyx":495 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 492, __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, 495, __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, 492, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":528 + /* "numcodecs/blosc.pyx":531 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -8594,38 +8594,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, 528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":534 * * * 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, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __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, 531, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __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, 531, __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, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":555 + /* "numcodecs/blosc.pyx":558 * """ * * 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, 555, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 558, __pyx_L1_error) - /* "numcodecs/blosc.pyx":556 + /* "numcodecs/blosc.pyx":559 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8633,12 +8633,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __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, 556, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":557 + /* "numcodecs/blosc.pyx":560 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8646,12 +8646,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 557, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __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, 557, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":558 + /* "numcodecs/blosc.pyx":561 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8659,12 +8659,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, 558, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __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, 558, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":562 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8672,86 +8672,86 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __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, 559, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":560 + /* "numcodecs/blosc.pyx":563 * 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, 560, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 563, __pyx_L1_error) - /* "numcodecs/blosc.pyx":562 + /* "numcodecs/blosc.pyx":565 * 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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __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, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 562, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 565, __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, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 565, __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, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 565, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":575 * 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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __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, 575, __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, 572, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":579 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< + * '''**Experimental**''' * 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__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 576, __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, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 576, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":584 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); @@ -8762,35 +8762,35 @@ if (!__Pyx_RefNanny) { PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)Py_None)); __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __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_9)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_9 = __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_9)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_9) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_9) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":589 * typesize, encoding_size, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_t_9 = __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__41)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_9 = __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__41)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_9) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_9) < 0) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":534 * * * class Blosc(Codec): # <<<<<<<<<<<<<< * """Codec providing compression using the Blosc meta-compressor. * */ - __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_9) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_9) < 0) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; From c88f24d4f138b8d6371092c2f2c93801f0d7b204 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Thu, 11 Jun 2020 17:45:51 -0600 Subject: [PATCH 13/20] removes extra line --- numcodecs/blosc.pyx | 1 - 1 file changed, 1 deletion(-) diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index d9e2c88b..685ac789 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -413,7 +413,6 @@ def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest= Size in number of bytes of the type we want to decode. encoding_size: int Size in number of bytes at the time of encoding - Returns ------- From 5a9eb6ec9cc521fda645a121c7c08e5fd8d41a84 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Thu, 11 Jun 2020 17:49:04 -0600 Subject: [PATCH 14/20] rollback c file noise changes --- numcodecs/compat_ext.c | 63 +++++++++++++++++----------------- numcodecs/lz4.c | 13 ++++--- numcodecs/vlen.c | 9 +++-- numcodecs/zstd.c | 77 ++++++++++++++++++++---------------------- 4 files changed, 78 insertions(+), 84 deletions(-) diff --git a/numcodecs/compat_ext.c b/numcodecs/compat_ext.c index dac8dbea..7242cc29 100644 --- a/numcodecs/compat_ext.c +++ b/numcodecs/compat_ext.c @@ -5,8 +5,7 @@ "distutils": { "depends": [], "extra_compile_args": [ - "-msse2", - "-mavx2" + "-stdlib=libc++" ], "name": "numcodecs.compat_ext", "sources": [ @@ -843,8 +842,8 @@ struct __pyx_obj_9numcodecs_10compat_ext_Buffer { * * * cdef class Buffer: # <<<<<<<<<<<<<< - * """Convenience class for buffer interface.""" - * + * """Compatibility class to work around fact that array.array does not support + * new-style buffer interface in PY2.""" */ struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer { @@ -1202,8 +1201,8 @@ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; /* Late includes */ -/* "numcodecs/compat_ext.pyx":15 - * """Convenience class for buffer interface.""" +/* "numcodecs/compat_ext.pyx":16 + * new-style buffer interface in PY2.""" * * def __cinit__(self, obj, flags): # <<<<<<<<<<<<<< * PyObject_GetBuffer(obj, &(self.buffer), flags) @@ -1241,11 +1240,11 @@ static int __pyx_pw_9numcodecs_10compat_ext_6Buffer_1__cinit__(PyObject *__pyx_v case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 15, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 16, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 15, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1258,7 +1257,7 @@ static int __pyx_pw_9numcodecs_10compat_ext_6Buffer_1__cinit__(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 15, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 16, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.compat_ext.Buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1279,17 +1278,17 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 Py_ssize_t __pyx_t_3; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "numcodecs/compat_ext.pyx":16 + /* "numcodecs/compat_ext.pyx":17 * * def __cinit__(self, obj, flags): * PyObject_GetBuffer(obj, &(self.buffer), flags) # <<<<<<<<<<<<<< * self.acquired = True * self.ptr = self.buffer.buf */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L1_error) - __pyx_t_2 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->buffer), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_2 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->buffer), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 17, __pyx_L1_error) - /* "numcodecs/compat_ext.pyx":17 + /* "numcodecs/compat_ext.pyx":18 * def __cinit__(self, obj, flags): * PyObject_GetBuffer(obj, &(self.buffer), flags) * self.acquired = True # <<<<<<<<<<<<<< @@ -1298,7 +1297,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 */ __pyx_v_self->acquired = 1; - /* "numcodecs/compat_ext.pyx":18 + /* "numcodecs/compat_ext.pyx":19 * PyObject_GetBuffer(obj, &(self.buffer), flags) * self.acquired = True * self.ptr = self.buffer.buf # <<<<<<<<<<<<<< @@ -1307,7 +1306,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 */ __pyx_v_self->ptr = ((char *)__pyx_v_self->buffer.buf); - /* "numcodecs/compat_ext.pyx":19 + /* "numcodecs/compat_ext.pyx":20 * self.acquired = True * self.ptr = self.buffer.buf * self.itemsize = self.buffer.itemsize # <<<<<<<<<<<<<< @@ -1317,7 +1316,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 __pyx_t_3 = __pyx_v_self->buffer.itemsize; __pyx_v_self->itemsize = __pyx_t_3; - /* "numcodecs/compat_ext.pyx":20 + /* "numcodecs/compat_ext.pyx":21 * self.ptr = self.buffer.buf * self.itemsize = self.buffer.itemsize * self.nbytes = self.buffer.len # <<<<<<<<<<<<<< @@ -1327,8 +1326,8 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 __pyx_t_3 = __pyx_v_self->buffer.len; __pyx_v_self->nbytes = __pyx_t_3; - /* "numcodecs/compat_ext.pyx":15 - * """Convenience class for buffer interface.""" + /* "numcodecs/compat_ext.pyx":16 + * new-style buffer interface in PY2.""" * * def __cinit__(self, obj, flags): # <<<<<<<<<<<<<< * PyObject_GetBuffer(obj, &(self.buffer), flags) @@ -1346,7 +1345,7 @@ static int __pyx_pf_9numcodecs_10compat_ext_6Buffer___cinit__(struct __pyx_obj_9 return __pyx_r; } -/* "numcodecs/compat_ext.pyx":22 +/* "numcodecs/compat_ext.pyx":23 * self.nbytes = self.buffer.len * * cpdef release(self): # <<<<<<<<<<<<<< @@ -1373,7 +1372,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9numcodecs_10compat_ext_6Buffer_3release)) { __Pyx_XDECREF(__pyx_r); @@ -1390,7 +1389,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -1411,7 +1410,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob #endif } - /* "numcodecs/compat_ext.pyx":23 + /* "numcodecs/compat_ext.pyx":24 * * cpdef release(self): * if self.acquired: # <<<<<<<<<<<<<< @@ -1421,7 +1420,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob __pyx_t_5 = (__pyx_v_self->acquired != 0); if (__pyx_t_5) { - /* "numcodecs/compat_ext.pyx":24 + /* "numcodecs/compat_ext.pyx":25 * cpdef release(self): * if self.acquired: * PyBuffer_Release(&(self.buffer)) # <<<<<<<<<<<<<< @@ -1430,7 +1429,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ PyBuffer_Release((&__pyx_v_self->buffer)); - /* "numcodecs/compat_ext.pyx":25 + /* "numcodecs/compat_ext.pyx":26 * if self.acquired: * PyBuffer_Release(&(self.buffer)) * self.acquired = False # <<<<<<<<<<<<<< @@ -1439,7 +1438,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ __pyx_v_self->acquired = 0; - /* "numcodecs/compat_ext.pyx":23 + /* "numcodecs/compat_ext.pyx":24 * * cpdef release(self): * if self.acquired: # <<<<<<<<<<<<<< @@ -1448,7 +1447,7 @@ static PyObject *__pyx_f_9numcodecs_10compat_ext_6Buffer_release(struct __pyx_ob */ } - /* "numcodecs/compat_ext.pyx":22 + /* "numcodecs/compat_ext.pyx":23 * self.nbytes = self.buffer.len * * cpdef release(self): # <<<<<<<<<<<<<< @@ -1492,7 +1491,7 @@ static PyObject *__pyx_pf_9numcodecs_10compat_ext_6Buffer_2release(struct __pyx_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("release", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9numcodecs_10compat_ext_6Buffer_release(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9numcodecs_10compat_ext_6Buffer_release(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1509,7 +1508,7 @@ static PyObject *__pyx_pf_9numcodecs_10compat_ext_6Buffer_2release(struct __pyx_ return __pyx_r; } -/* "numcodecs/compat_ext.pyx":27 +/* "numcodecs/compat_ext.pyx":28 * self.acquired = False * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1532,16 +1531,16 @@ static void __pyx_pf_9numcodecs_10compat_ext_6Buffer_4__dealloc__(struct __pyx_o PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "numcodecs/compat_ext.pyx":28 + /* "numcodecs/compat_ext.pyx":29 * * def __dealloc__(self): * self.release() # <<<<<<<<<<<<<< */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/compat_ext.pyx":27 + /* "numcodecs/compat_ext.pyx":28 * self.acquired = False * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1736,7 +1735,7 @@ static PyTypeObject __pyx_type_9numcodecs_10compat_ext_Buffer = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Convenience class for buffer interface.", /*tp_doc*/ + "Compatibility class to work around fact that array.array does not support\n new-style buffer interface in PY2.", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ diff --git a/numcodecs/lz4.c b/numcodecs/lz4.c index 01cb5a3e..863cf389 100644 --- a/numcodecs/lz4.c +++ b/numcodecs/lz4.c @@ -4,22 +4,21 @@ { "distutils": { "depends": [ - "c-blosc/internal-complibs/lz4-1.9.2/lz4.h", + "c-blosc/internal-complibs/lz4-1.9.1/lz4.h", "numcodecs/stdint_compat.h" ], "extra_compile_args": [ - "-msse2", - "-mavx2" + "-stdlib=libc++" ], "include_dirs": [ "numcodecs", - "c-blosc/internal-complibs/lz4-1.9.2" + "c-blosc/internal-complibs/lz4-1.9.1" ], "name": "numcodecs.lz4", "sources": [ "numcodecs/lz4.pyx", - "c-blosc/internal-complibs/lz4-1.9.2/lz4hc.c", - "c-blosc/internal-complibs/lz4-1.9.2/lz4.c" + "c-blosc/internal-complibs/lz4-1.9.1/lz4hc.c", + "c-blosc/internal-complibs/lz4-1.9.1/lz4.c" ] }, "module_name": "numcodecs.lz4" @@ -827,7 +826,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/lz4.pyx", - ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", + "type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ diff --git a/numcodecs/vlen.c b/numcodecs/vlen.c index 70de9664..4f8070d9 100644 --- a/numcodecs/vlen.c +++ b/numcodecs/vlen.c @@ -7,8 +7,7 @@ "numcodecs/stdint_compat.h" ], "extra_compile_args": [ - "-msse2", - "-mavx2" + "-stdlib=libc++" ], "include_dirs": [ "numcodecs" @@ -827,9 +826,9 @@ static const char *__pyx_f[] = { "numcodecs/vlen.pyx", "stringsource", "numcodecs/compat_ext.pxd", - ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", - ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/bool.pxd", - ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/complex.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", }; /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; diff --git a/numcodecs/zstd.c b/numcodecs/zstd.c index 38793995..522e5516 100644 --- a/numcodecs/zstd.c +++ b/numcodecs/zstd.c @@ -4,53 +4,50 @@ { "distutils": { "depends": [ - "c-blosc/internal-complibs/zstd-1.4.4/zstd.h" + "c-blosc/internal-complibs/zstd-1.4.1/zstd.h" ], "extra_compile_args": [ - "-msse2", - "-mavx2" + "-stdlib=libc++" ], "include_dirs": [ - "c-blosc/internal-complibs/zstd-1.4.4", - "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" + "c-blosc/internal-complibs/zstd-1.4.1", + "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" ], "name": "numcodecs.zstd", "sources": [ "numcodecs/zstd.pyx", - "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/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" ] }, "module_name": "numcodecs.zstd" @@ -857,7 +854,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/zstd.pyx", - ".tox/py37/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd", + "type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ From 67f5280ac140e6b80045dcf44e8bd19b8e434612 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Thu, 11 Jun 2020 18:58:03 -0600 Subject: [PATCH 15/20] encoding size is taken from source header now --- numcodecs/blosc.c | 1402 ++++++++++++++++++------------------- numcodecs/blosc.pyx | 18 +- numcodecs/tests/common.py | 18 +- 3 files changed, 715 insertions(+), 723 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index 9cdda49e..3cb841e6 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -912,7 +912,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/blosc.pyx", - ".tox/py36/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ @@ -1290,9 +1290,6 @@ 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); -/* PyIntCompare.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - /* 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) ?\ @@ -1315,6 +1312,19 @@ 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); +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* None.proto */ +static CYTHON_INLINE int __Pyx_div_int(int, int); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +/* None.proto */ +static CYTHON_INLINE int __Pyx_mod_int(int, int); + /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); @@ -1546,6 +1556,7 @@ int __pyx_module_is_main_numcodecs__blosc = 0; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_print; static const char __pyx_k_[] = ","; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; @@ -1578,6 +1589,7 @@ static const char __pyx_k_cname[] = "cname"; 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_print[] = "print"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_Buffer[] = "Buffer"; @@ -1804,6 +1816,7 @@ static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_pid; static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_proc; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; @@ -1843,13 +1856,13 @@ 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_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_typesize, PyObject *__pyx_v_encoding_size, PyObject *__pyx_v_dest); /* 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_typesize, 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_6decode_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, int __pyx_v_start, int __pyx_v_nitems, int __pyx_v_typesize, int __pyx_v_encoding_size, PyObject *__pyx_v_out); /* 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, int __pyx_v_typesize, 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; @@ -4653,37 +4666,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ /* Python wrapper */ 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, typesize=0, encoding_size=0, 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 dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\n \n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +static char __pyx_doc_9numcodecs_5blosc_24decompress_partial[] = "decompress_partial(source, start, nitems, typesize=0, 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 dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\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_typesize = 0; - PyObject *__pyx_v_encoding_size = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __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_typesize,&__pyx_n_s_encoding_size,&__pyx_n_s_dest,0}; - PyObject* values[6] = {0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_typesize,&__pyx_n_s_dest,0}; + PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); - values[4] = ((PyObject *)__pyx_int_0); - values[5] = ((PyObject *)Py_None); + values[4] = ((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 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -4706,13 +4715,13 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx 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, 6, 1); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 5, 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, 6, 2); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 5, 2); __PYX_ERR(0, 397, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -4722,15 +4731,9 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx } CYTHON_FALLTHROUGH; case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size); - if (value) { values[4] = value; kw_args--; } - } - CYTHON_FALLTHROUGH; - case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest); - if (value) { values[5] = value; kw_args--; } + if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -4738,8 +4741,6 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -4755,26 +4756,26 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx __pyx_v_start = values[1]; __pyx_v_nitems = values[2]; __pyx_v_typesize = values[3]; - __pyx_v_encoding_size = values[4]; - __pyx_v_dest = values[5]; + __pyx_v_dest = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 5, 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_typesize, __pyx_v_encoding_size, __pyx_v_dest); + __pyx_r = __pyx_pf_9numcodecs_5blosc_24decompress_partial(__pyx_self, __pyx_v_source, __pyx_v_start, __pyx_v_nitems, __pyx_v_typesize, __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -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_typesize, PyObject *__pyx_v_encoding_size, PyObject *__pyx_v_dest) { +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_typesize, PyObject *__pyx_v_dest) { int __pyx_v_ret; + int __pyx_v_encoding_size; int __pyx_v_nitems_bytes; int __pyx_v_nitems_blosc; int __pyx_v_start_bytes; @@ -4796,21 +4797,21 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - size_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_UCS4 __pyx_t_13; - int __pyx_t_14; - char const *__pyx_t_15; - PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + size_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_UCS4 __pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; __Pyx_RefNannySetupContext("decompress_partial", 0); __Pyx_INCREF(__pyx_v_typesize); - __Pyx_INCREF(__pyx_v_encoding_size); __Pyx_INCREF(__pyx_v_dest); /* "numcodecs/blosc.pyx":436 @@ -4851,136 +4852,144 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< * - * # determine typesize if not given + * # 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":443 * + * # get encoding size from source buffer header + * encoding_size = source[3] # <<<<<<<<<<<<<< + * # determine typesize if not given + * if typesize == 0: + */ + __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, 443, __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, 443, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_encoding_size = __pyx_t_4; + + /* "numcodecs/blosc.pyx":445 + * encoding_size = source[3] * # determine typesize if not given * if typesize == 0: # <<<<<<<<<<<<<< - * typesize = source[3] - * # infers encoding size from typesize if not given. Could be wrong if + * typesize = encoding_size + * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __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, 443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_4) { + if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":444 + /* "numcodecs/blosc.pyx":446 * # determine typesize if not given * if typesize == 0: - * typesize = source[3] # <<<<<<<<<<<<<< - * # infers encoding size from typesize if not given. Could be wrong if - * # array is converted before encoding. + * typesize = encoding_size # <<<<<<<<<<<<<< + * + * print(encoding_size) */ - __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, 444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_typesize, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":443 - * + /* "numcodecs/blosc.pyx":445 + * encoding_size = source[3] * # determine typesize if not given * if typesize == 0: # <<<<<<<<<<<<<< - * typesize = source[3] - * # infers encoding size from typesize if not given. Could be wrong if + * typesize = encoding_size + * */ } - /* "numcodecs/blosc.pyx":447 - * # infers encoding size from typesize if not given. Could be wrong if - * # array is converted before encoding. - * if encoding_size == 0: # <<<<<<<<<<<<<< - * encoding_size = typesize + /* "numcodecs/blosc.pyx":448 + * typesize = encoding_size + * + * print(encoding_size) # <<<<<<<<<<<<<< + * print(typesize) * */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_encoding_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __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, 447, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":448 - * # array is converted before encoding. - * if encoding_size == 0: - * encoding_size = typesize # <<<<<<<<<<<<<< + /* "numcodecs/blosc.pyx":449 * - * # convert varibles to handle type and encoding sizes - */ - __Pyx_INCREF(__pyx_v_typesize); - __Pyx_DECREF_SET(__pyx_v_encoding_size, __pyx_v_typesize); - - /* "numcodecs/blosc.pyx":447 - * # infers encoding size from typesize if not given. Could be wrong if - * # array is converted before encoding. - * if encoding_size == 0: # <<<<<<<<<<<<<< - * encoding_size = typesize + * print(encoding_size) + * print(typesize) # <<<<<<<<<<<<<< * + * # convert varibles to handle type and encoding sizes */ - } + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":451 + /* "numcodecs/blosc.pyx":452 * * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * typesize # <<<<<<<<<<<<<< * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_nitems_bytes = __pyx_t_5; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_nitems_bytes = __pyx_t_4; - /* "numcodecs/blosc.pyx":452 + /* "numcodecs/blosc.pyx":453 * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * typesize * nitems_blosc = nitems_bytes // encoding_size # <<<<<<<<<<<<<< * start_bytes = (start * typesize) * start_blosc = start_bytes // encoding_size */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_FloorDivide(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_nitems_blosc = __pyx_t_5; + if (unlikely(__pyx_v_encoding_size == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 453, __pyx_L1_error) + } + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_encoding_size == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_nitems_bytes))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(0, 453, __pyx_L1_error) + } + __pyx_v_nitems_blosc = __Pyx_div_int(__pyx_v_nitems_bytes, __pyx_v_encoding_size); - /* "numcodecs/blosc.pyx":453 + /* "numcodecs/blosc.pyx":454 * nitems_bytes = nitems * typesize * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) # <<<<<<<<<<<<<< * start_blosc = start_bytes // encoding_size * */ - __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_start_bytes = __pyx_t_5; + __pyx_v_start_bytes = __pyx_t_4; - /* "numcodecs/blosc.pyx":454 + /* "numcodecs/blosc.pyx":455 * nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * typesize) * start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_FloorDivide(__pyx_t_2, __pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_start_blosc = __pyx_t_5; + if (unlikely(__pyx_v_encoding_size == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 455, __pyx_L1_error) + } + else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_encoding_size == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_start_bytes))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(0, 455, __pyx_L1_error) + } + __pyx_v_start_blosc = __Pyx_div_int(__pyx_v_start_bytes, __pyx_v_encoding_size); - /* "numcodecs/blosc.pyx":456 + /* "numcodecs/blosc.pyx":457 * start_blosc = start_bytes // encoding_size * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< @@ -4989,24 +4998,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_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, 456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) { + if (unlikely(__pyx_v_encoding_size == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 457, __pyx_L1_error) + } + if (unlikely(!((__Pyx_mod_int(__pyx_v_nitems_bytes, __pyx_v_encoding_size) == 0) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_the_encoding_size_is_not_a_divis); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 457, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":457 + /* "numcodecs/blosc.pyx":458 * * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) # <<<<<<<<<<<<<< @@ -5015,112 +5018,111 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_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, 457, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(__pyx_v_encoding_size == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 458, __pyx_L1_error) + } + if (unlikely(!((__Pyx_mod_int(__pyx_v_start_bytes, __pyx_v_encoding_size) == 0) != 0))) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Remainder(__pyx_t_7, __pyx_v_encoding_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(__pyx_v_encoding_size == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(0, 458, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyInt_From_int(__Pyx_mod_int(__pyx_v_start_blosc, __pyx_v_encoding_size)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(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_t_9 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_encoding_size, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_6); - __Pyx_INCREF(__pyx_v_encoding_size); - __Pyx_GIVEREF(__pyx_v_encoding_size); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_encoding_size); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, __pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - PyErr_SetObject(PyExc_AssertionError, __pyx_t_2); + __pyx_t_1 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 457, __pyx_L1_error) + PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 458, __pyx_L1_error) } } #endif - /* "numcodecs/blosc.pyx":460 + /* "numcodecs/blosc.pyx":461 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ - __pyx_t_4 = (__pyx_v_dest == Py_None); - __pyx_t_10 = (__pyx_t_4 != 0); - if (__pyx_t_10) { + __pyx_t_5 = (__pyx_v_dest == Py_None); + __pyx_t_11 = (__pyx_t_5 != 0); + if (__pyx_t_11) { - /* "numcodecs/blosc.pyx":461 + /* "numcodecs/blosc.pyx":462 * # 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_2 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); + __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":462 + /* "numcodecs/blosc.pyx":463 * if dest is None: * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -5129,7 +5131,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":463 + /* "numcodecs/blosc.pyx":464 * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< @@ -5138,17 +5140,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; - /* "numcodecs/blosc.pyx":460 + /* "numcodecs/blosc.pyx":461 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ - goto __pyx_L5; + goto __pyx_L4; } - /* "numcodecs/blosc.pyx":465 + /* "numcodecs/blosc.pyx":466 * dest_nbytes = nitems_bytes * else: * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< @@ -5156,50 +5158,50 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * dest_ptr = dest_buffer.ptr */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dest); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dest); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + 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_v_arr = __pyx_t_1; + __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":467 * 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_2 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9numcodecs_10compat_ext_Buffer), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_dest_buffer, ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)__pyx_t_2)); - __pyx_t_2 = 0; + 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, 467, __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":467 + /* "numcodecs/blosc.pyx":468 * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< @@ -5209,19 +5211,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_dest_buffer->ptr; __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":468 + /* "numcodecs/blosc.pyx":469 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< * * # try decompression */ - __pyx_t_11 = __pyx_v_dest_buffer->nbytes; - __pyx_v_dest_nbytes = __pyx_t_11; + __pyx_t_12 = __pyx_v_dest_buffer->nbytes; + __pyx_v_dest_nbytes = __pyx_t_12; } - __pyx_L5:; + __pyx_L4:; - /* "numcodecs/blosc.pyx":471 + /* "numcodecs/blosc.pyx":472 * * # try decompression * try: # <<<<<<<<<<<<<< @@ -5230,74 +5232,74 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*try:*/ { - /* "numcodecs/blosc.pyx":472 + /* "numcodecs/blosc.pyx":473 * # try decompression * try: * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems_blosc, dest_nbytes)) */ - __pyx_t_10 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_blosc) != 0); - if (unlikely(__pyx_t_10)) { + __pyx_t_11 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_blosc) != 0); + if (unlikely(__pyx_t_11)) { - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":474 * try: * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = 0; - __pyx_t_13 = 127; + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = 0; + __pyx_t_14 = 127; __Pyx_INCREF(__pyx_kp_u_destination_buffer_too_small_exp); - __pyx_t_12 += 48; + __pyx_t_13 += 48; __Pyx_GIVEREF(__pyx_kp_u_destination_buffer_too_small_exp); - PyTuple_SET_ITEM(__pyx_t_2, 0, __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":474 + /* "numcodecs/blosc.pyx":475 * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' * 'got %s' % (nitems_blosc, dest_nbytes)) # <<<<<<<<<<<<<< * * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) */ - __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 += __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_12 += 6; + __pyx_t_13 += 6; __Pyx_GIVEREF(__pyx_kp_u_got); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_got); - __pyx_t_1 = __Pyx_PyUnicode_From_size_t(__pyx_v_dest_nbytes, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1); - __pyx_t_1 = 0; + 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, 475, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 += __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":473 + /* "numcodecs/blosc.pyx":474 * try: * if dest_nbytes < nitems_blosc: * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< * 'got %s' % (nitems_blosc, dest_nbytes)) * */ - __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 473, __pyx_L7_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 474, __pyx_L6_error) - /* "numcodecs/blosc.pyx":472 + /* "numcodecs/blosc.pyx":473 * # try decompression * try: * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< @@ -5306,7 +5308,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":476 + /* "numcodecs/blosc.pyx":477 * 'got %s' % (nitems_blosc, dest_nbytes)) * * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) # <<<<<<<<<<<<<< @@ -5316,7 +5318,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nitems_blosc, __pyx_v_dest_ptr); } - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":480 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5325,33 +5327,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*finally:*/ { /*normal exit:*/{ - __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":481 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< * dest_buffer.release() * */ - __pyx_t_10 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); - __pyx_t_4 = (__pyx_t_10 != 0); - if (__pyx_t_4) { + __pyx_t_11 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_5 = (__pyx_t_11 != 0); + if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":482 * 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_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":481 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5359,64 +5361,65 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * */ } - goto __pyx_L8; + goto __pyx_L7; } - __pyx_L7_error:; + __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_16); + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); - __pyx_t_5 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; + __Pyx_XGOTREF(__pyx_t_22); + __pyx_t_4 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { - /* "numcodecs/blosc.pyx":479 + /* "numcodecs/blosc.pyx":480 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< * if dest_buffer is not None: * dest_buffer.release() */ - __pyx_t_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_source_buffer->__pyx_vtab)->release(__pyx_v_source_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 480, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":481 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< * dest_buffer.release() * */ - __pyx_t_4 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); - __pyx_t_10 = (__pyx_t_4 != 0); - if (__pyx_t_10) { + __pyx_t_5 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_11 = (__pyx_t_5 != 0); + if (__pyx_t_11) { - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":482 * 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_2 = ((struct __pyx_vtabstruct_9numcodecs_10compat_ext_Buffer *)__pyx_v_dest_buffer->__pyx_vtab)->release(__pyx_v_dest_buffer, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 482, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":481 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5426,69 +5429,69 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } } if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } - __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); - __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; - __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L1_error; - __pyx_L12_error:; + __pyx_L11_error:; if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L7:; } - /* "numcodecs/blosc.pyx":484 + /* "numcodecs/blosc.pyx":485 * * # 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_10 = ((__pyx_v_ret <= 0) != 0); - if (unlikely(__pyx_t_10)) { + __pyx_t_11 = ((__pyx_v_ret <= 0) != 0); + if (unlikely(__pyx_t_11)) { - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":486 * # 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_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __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_1, 0, __pyx_kp_u_error_during_blosc_partial_decom); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + 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, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 485, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 486, __pyx_L1_error) - /* "numcodecs/blosc.pyx":484 + /* "numcodecs/blosc.pyx":485 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5497,7 +5500,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":487 + /* "numcodecs/blosc.pyx":488 * raise RuntimeError('error during blosc partial decompression: %d', ret) * * return dest # <<<<<<<<<<<<<< @@ -5512,7 +5515,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ @@ -5525,6 +5528,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("numcodecs.blosc.decompress_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5532,14 +5536,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_XDECREF((PyObject *)__pyx_v_dest_buffer); __Pyx_XDECREF(__pyx_v_arr); __Pyx_XDECREF(__pyx_v_typesize); - __Pyx_XDECREF(__pyx_v_encoding_size); __Pyx_XDECREF(__pyx_v_dest); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "numcodecs/blosc.pyx":495 +/* "numcodecs/blosc.pyx":496 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5575,16 +5578,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":497 + /* "numcodecs/blosc.pyx":498 * 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, 497, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __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, 497, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5599,27 +5602,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 497, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __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":500 + /* "numcodecs/blosc.pyx":501 * * # 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, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __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, 500, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 501, __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":501 + /* "numcodecs/blosc.pyx":502 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5631,7 +5634,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":500 + /* "numcodecs/blosc.pyx":501 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5640,25 +5643,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":504 + /* "numcodecs/blosc.pyx":505 * * # 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, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __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, 504, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __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, 504, __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, 505, __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, 504, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":508 + /* "numcodecs/blosc.pyx":509 * # 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 # <<<<<<<<<<<<<< @@ -5670,7 +5673,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":504 + /* "numcodecs/blosc.pyx":505 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5679,25 +5682,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":510 + /* "numcodecs/blosc.pyx":511 * 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, 510, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __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, 510, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 510, __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, 511, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 511, __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, 510, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 510, __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, 511, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -5705,19 +5708,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":512 + /* "numcodecs/blosc.pyx":513 * 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, 512, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":510 + /* "numcodecs/blosc.pyx":511 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5727,7 +5730,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":521 + /* "numcodecs/blosc.pyx":522 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5735,13 +5738,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 521, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __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, 521, __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, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":522 + /* "numcodecs/blosc.pyx":523 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5751,7 +5754,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":521 + /* "numcodecs/blosc.pyx":522 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5761,30 +5764,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":523 + /* "numcodecs/blosc.pyx":524 * 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, 523, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __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, 523, __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, 524, __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":524 + /* "numcodecs/blosc.pyx":525 * _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, 524, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __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, 524, __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, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5799,12 +5802,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 524, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __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, 524, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __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, 524, __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, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5819,16 +5822,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 524, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __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, 524, __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, 525, __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":523 + /* "numcodecs/blosc.pyx":524 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5838,7 +5841,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":526 + /* "numcodecs/blosc.pyx":527 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5846,9 +5849,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 526, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __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, 526, __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, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5863,13 +5866,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 526, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __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, 526, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __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, 526, __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, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -5878,7 +5881,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":528 + /* "numcodecs/blosc.pyx":529 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5890,7 +5893,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":495 + /* "numcodecs/blosc.pyx":496 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5914,7 +5917,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":565 +/* "numcodecs/blosc.pyx":566 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5929,7 +5932,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 565, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5943,7 +5946,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 565, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -6036,7 +6039,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, 565, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 566, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6061,7 +6064,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, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 566, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6084,16 +6087,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":566 + /* "numcodecs/blosc.pyx":567 * * 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, 566, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 567, __pyx_L1_error) - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":568 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6104,14 +6107,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":568 + /* "numcodecs/blosc.pyx":569 * 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, 568, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -6125,13 +6128,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, 568, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __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, 568, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":568 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6141,7 +6144,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":570 + /* "numcodecs/blosc.pyx":571 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -6149,38 +6152,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, 570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 571, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":571 + /* "numcodecs/blosc.pyx":572 * 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, 571, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":573 * 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, 572, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 573, __pyx_L1_error) - /* "numcodecs/blosc.pyx":573 + /* "numcodecs/blosc.pyx":574 * 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, 573, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 574, __pyx_L1_error) - /* "numcodecs/blosc.pyx":565 + /* "numcodecs/blosc.pyx":566 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -6203,7 +6206,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":575 +/* "numcodecs/blosc.pyx":576 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6244,11 +6247,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, 575, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 576, __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, 575, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 576, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6261,7 +6264,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, 575, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6289,16 +6292,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":577 * * 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, 576, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __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, 576, __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, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6315,7 +6318,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, 576, __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, 577, __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; @@ -6324,14 +6327,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, 576, __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, 577, __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, 576, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __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; @@ -6342,7 +6345,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, 576, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6350,7 +6353,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":577 + /* "numcodecs/blosc.pyx":578 * 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) # <<<<<<<<<<<<<< @@ -6358,15 +6361,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, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __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, 577, __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, 578, __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, 577, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __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, 577, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __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, 577, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -6383,7 +6386,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, 577, __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, 578, __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; @@ -6395,7 +6398,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, 577, __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, 578, __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; @@ -6405,7 +6408,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, 577, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __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; @@ -6425,7 +6428,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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6434,7 +6437,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":575 + /* "numcodecs/blosc.pyx":576 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6461,7 +6464,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":579 +/* "numcodecs/blosc.pyx":580 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6506,7 +6509,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, 579, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 580, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6516,7 +6519,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, 579, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6534,7 +6537,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, 579, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6559,16 +6562,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":581 + /* "numcodecs/blosc.pyx":582 * def decode(self, buf, out=None): * '''**Experimental**''' * 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, 581, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __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, 581, __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, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6585,7 +6588,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, 581, __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, 582, __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; @@ -6594,14 +6597,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, 581, __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, 582, __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, 581, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __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; @@ -6612,7 +6615,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, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6620,15 +6623,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":582 + /* "numcodecs/blosc.pyx":583 * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -6645,7 +6648,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, 582, __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, 583, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6653,13 +6656,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, 582, __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, 583, __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, 582, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __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; @@ -6670,7 +6673,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, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -6679,7 +6682,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":579 + /* "numcodecs/blosc.pyx":580 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6703,17 +6706,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":584 +/* "numcodecs/blosc.pyx":585 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ /* 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, int typesize=0, int encoding_size=0, out=None)"; +static char __pyx_doc_9numcodecs_5blosc_5Blosc_6decode_partial[] = "Blosc.decode_partial(self, buf, int start, int nitems, int typesize=0, out=None)"; 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; @@ -6721,21 +6724,18 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p int __pyx_v_start; int __pyx_v_nitems; int __pyx_v_typesize; - int __pyx_v_encoding_size; 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_typesize,&__pyx_n_s_encoding_size,&__pyx_n_s_out,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - values[6] = ((PyObject *)((PyObject *)Py_None)); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_buf,&__pyx_n_s_start,&__pyx_n_s_nitems,&__pyx_n_s_typesize,&__pyx_n_s_out,0}; + PyObject* values[6] = {0,0,0,0,0,0}; + values[5] = ((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 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); @@ -6760,19 +6760,19 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p 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, 7, 1); __PYX_ERR(0, 584, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 6, 1); __PYX_ERR(0, 585, __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, 7, 2); __PYX_ERR(0, 584, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 6, 2); __PYX_ERR(0, 585, __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, 7, 3); __PYX_ERR(0, 584, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 6, 3); __PYX_ERR(0, 585, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -6782,24 +6782,16 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } CYTHON_FALLTHROUGH; case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding_size); - if (value) { values[5] = value; kw_args--; } - } - CYTHON_FALLTHROUGH; - case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); - if (value) { values[6] = value; kw_args--; } + if (value) { values[5] = 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, 584, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 585, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); @@ -6814,36 +6806,31 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 584, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) if (values[4]) { - __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) + __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) } else { __pyx_v_typesize = ((int)((int)0)); } - if (values[5]) { - __pyx_v_encoding_size = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_encoding_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) - } else { - __pyx_v_encoding_size = ((int)((int)0)); - } - __pyx_v_out = values[6]; + __pyx_v_out = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 585, __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_typesize, __pyx_v_encoding_size, __pyx_v_out); + __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_typesize, __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, int __pyx_v_typesize, int __pyx_v_encoding_size, PyObject *__pyx_v_out) { +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, int __pyx_v_typesize, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6852,20 +6839,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":586 * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) # <<<<<<<<<<<<<< * return decompress_partial(buf, start, nitems, - * typesize, encoding_size, dest=out) + * typesize, dest=out) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __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, 585, __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, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6882,7 +6868,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 585, __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, 586, __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; @@ -6891,14 +6877,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 585, __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, 586, __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, 585, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __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; @@ -6909,7 +6895,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6917,89 +6903,84 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":586 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + /* "numcodecs/blosc.pyx":587 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, encoding_size, dest=out) + * typesize, dest=out) * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __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, 586, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __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, 586, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "numcodecs/blosc.pyx":587 + /* "numcodecs/blosc.pyx":588 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, - * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< + * typesize, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - /* "numcodecs/blosc.pyx":586 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + /* "numcodecs/blosc.pyx":587 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, encoding_size, dest=out) + * typesize, dest=out) * */ - __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buf); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; - __pyx_t_4 = 0; - /* "numcodecs/blosc.pyx":587 + /* "numcodecs/blosc.pyx":588 * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, - * typesize, encoding_size, dest=out) # <<<<<<<<<<<<<< + * typesize, dest=out) # <<<<<<<<<<<<<< * * def __repr__(self): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - /* "numcodecs/blosc.pyx":586 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): + /* "numcodecs/blosc.pyx":587 + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, encoding_size, dest=out) + * typesize, dest=out) * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":584 + /* "numcodecs/blosc.pyx":585 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ @@ -7011,7 +6992,6 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode_partial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7021,8 +7001,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":589 - * typesize, encoding_size, dest=out) +/* "numcodecs/blosc.pyx":590 + * typesize, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -7056,28 +7036,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":590 + /* "numcodecs/blosc.pyx":591 * * 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, 590, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":591 + /* "numcodecs/blosc.pyx":592 * 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, 591, __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, 592, __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, 591, __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, 592, __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; @@ -7090,16 +7070,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":592 + /* "numcodecs/blosc.pyx":593 * 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, 592, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __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, 592, __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, 593, __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; @@ -7112,16 +7092,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":593 + /* "numcodecs/blosc.pyx":594 * (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, 593, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __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, 593, __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, 594, __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; @@ -7134,25 +7114,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":594 + /* "numcodecs/blosc.pyx":595 * 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, 594, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __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, 594, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __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, 594, __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, 595, __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, 594, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __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, 594, __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, 595, __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; @@ -7165,15 +7145,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":595 + /* "numcodecs/blosc.pyx":596 * 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, 595, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 596, __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, 595, __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, 596, __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; @@ -7186,20 +7166,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":590 + /* "numcodecs/blosc.pyx":591 * * 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, 590, __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, 591, __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":596 + /* "numcodecs/blosc.pyx":597 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -7209,8 +7189,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":589 - * typesize, encoding_size, dest=out) + /* "numcodecs/blosc.pyx":590 + * typesize, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -7396,6 +7376,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_proc, __pyx_k_proc, sizeof(__pyx_k_proc), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, @@ -7429,6 +7410,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __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) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 448, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7587,89 +7569,89 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ - __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_nitems_bytes, __pyx_n_s_nitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __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_tuple__27 = PyTuple_Pack(17, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_encoding_size, __pyx_n_s_nitems_bytes, __pyx_n_s_nitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __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(6, 0, 17, 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) + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 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":495 + /* "numcodecs/blosc.pyx":496 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 495, __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, 496, __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, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 495, __pyx_L1_error) + __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, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 496, __pyx_L1_error) - /* "numcodecs/blosc.pyx":565 + /* "numcodecs/blosc.pyx":566 * 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__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, 565, __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, 566, __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, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 565, __pyx_L1_error) + __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, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 566, __pyx_L1_error) - /* "numcodecs/blosc.pyx":575 + /* "numcodecs/blosc.pyx":576 * 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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 575, __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, 576, __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, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 575, __pyx_L1_error) + __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, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 576, __pyx_L1_error) - /* "numcodecs/blosc.pyx":579 + /* "numcodecs/blosc.pyx":580 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) */ - __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, 579, __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, 580, __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, 579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 579, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 579, __pyx_L1_error) + __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, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":584 + /* "numcodecs/blosc.pyx":585 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __pyx_tuple__38 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_encoding_size, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 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, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 585, __pyx_L1_error) - /* "numcodecs/blosc.pyx":589 - * typesize, encoding_size, dest=out) + /* "numcodecs/blosc.pyx":590 + * typesize, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 590, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7876,7 +7858,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_blosc(PyObject *__pyx_pyinit_modul PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -8543,7 +8524,7 @@ if (!__Pyx_RefNanny) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ @@ -8552,35 +8533,35 @@ if (!__Pyx_RefNanny) { 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":492 + /* "numcodecs/blosc.pyx":493 * # 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, 492, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 493, __pyx_L1_error) - /* "numcodecs/blosc.pyx":495 + /* "numcodecs/blosc.pyx":496 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 495, __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, 496, __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, 495, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":531 + /* "numcodecs/blosc.pyx":532 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -8594,38 +8575,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, 531, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":534 + /* "numcodecs/blosc.pyx":535 * * * 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, 534, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __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, 534, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __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, 534, __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, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":558 + /* "numcodecs/blosc.pyx":559 * """ * * 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, 558, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":560 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8633,12 +8614,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __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, 559, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":560 + /* "numcodecs/blosc.pyx":561 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8646,12 +8627,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __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, 560, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":561 + /* "numcodecs/blosc.pyx":562 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8659,12 +8640,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, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __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, 561, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":562 + /* "numcodecs/blosc.pyx":563 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8672,126 +8653,121 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __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, 562, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":564 * 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, 563, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 564, __pyx_L1_error) - /* "numcodecs/blosc.pyx":565 + /* "numcodecs/blosc.pyx":566 * 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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __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, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 565, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 566, __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, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __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, 565, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":575 + /* "numcodecs/blosc.pyx":576 * 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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 575, __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, 576, __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, 575, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":579 + /* "numcodecs/blosc.pyx":580 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) */ - __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, 579, __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, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 579, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":584 + /* "numcodecs/blosc.pyx":585 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, int encoding_size=0, out=None): # <<<<<<<<<<<<<< + * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, */ - __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_INCREF(((PyObject *)Py_None)); __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)Py_None)); __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __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_9)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_9) < 0) __PYX_ERR(0, 584, __pyx_L1_error) + __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, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_8) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":589 - * typesize, encoding_size, dest=out) + /* "numcodecs/blosc.pyx":590 + * typesize, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ * (type(self).__name__, */ - __pyx_t_9 = __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__41)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_9) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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__41)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __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, 590, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":534 + /* "numcodecs/blosc.pyx":535 * * * class Blosc(Codec): # <<<<<<<<<<<<<< * """Codec providing compression using the Blosc meta-compressor. * */ - __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Blosc, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_9) < 0) __PYX_ERR(0, 534, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 535, __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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8815,7 +8791,6 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init numcodecs.blosc", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -10010,73 +9985,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssiz return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } -/* PyIntCompare */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { - if (op1 == op2) { - Py_RETURN_TRUE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = Py_SIZE(op1); - const digit* digits = ((PyLongObject*)op1)->ob_digit; - if (intval == 0) { - if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } else if (intval < 0) { - if (size >= 0) - Py_RETURN_FALSE; - intval = -intval; - size = -size; - } else { - if (size <= 0) - Py_RETURN_FALSE; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - return ( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; @@ -10164,6 +10072,88 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_TRUE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_FALSE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_FALSE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* None */ +static CYTHON_INLINE int __Pyx_div_int(int a, int b) { + int q = a / b; + int r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* None */ +static CYTHON_INLINE int __Pyx_mod_int(int a, int b) { + int r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} + /* CIntToPyUnicode */ #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 685ac789..3cc406e6 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -394,7 +394,7 @@ def decompress(source, dest=None): return dest -def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest=None): +def decompress_partial(source, start, nitems, typesize=0, dest=None): """**Experimental** Decompress data of only a part of a buffer. @@ -425,6 +425,7 @@ def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest= cdef: int ret + int encoding_size int nitems_bytes int nitems_blosc int start_bytes @@ -438,13 +439,14 @@ def decompress_partial(source, start, nitems, typesize=0, encoding_size=0, dest= source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) source_ptr = source_buffer.ptr + # get encoding size from source buffer header + encoding_size = source[3] # determine typesize if not given if typesize == 0: - typesize = source[3] - # infers encoding size from typesize if not given. Could be wrong if - # array is converted before encoding. - if encoding_size == 0: - encoding_size = typesize + typesize = encoding_size + + print(encoding_size) + print(typesize) # convert varibles to handle type and encoding sizes nitems_bytes = nitems * typesize @@ -580,10 +582,10 @@ 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, int typesize=0, int encoding_size=0, out=None): + def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress_partial(buf, start, nitems, - typesize, encoding_size, dest=out) + typesize, dest=out) def __repr__(self): r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index 7171afc2..e8c7b949 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -133,19 +133,19 @@ def check_encode_decode_partial(arr, codec, precision=None): # test encoding of bytes buf = arr.tobytes(order='A') enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test encoding of bytearray buf = bytearray(arr.tobytes(order='A')) enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test encoding of array.array buf = array.array('b', arr.tobytes(order='A')) enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(enc, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # decoding should support any object exporting the buffer protocol, @@ -154,31 +154,31 @@ def check_encode_decode_partial(arr, codec, precision=None): enc_bytes = ensure_bytes(enc) # test decoding of raw bytes - dec = codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test decoding of bytearray - dec = codec.decode_partial(bytearray(enc_bytes), start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(bytearray(enc_bytes), start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test decoding of array.array buf = array.array('b', enc_bytes) - dec = codec.decode_partial(buf, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(buf, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test decoding of numpy array buf = np.frombuffer(enc_bytes, dtype='u1') - dec = codec.decode_partial(buf, start, nitems, ITEMSIZE, 1) + dec = codec.decode_partial(buf, start, nitems, ITEMSIZE) compare_arrays(compare_arr, dec, precision=precision) # test decoding directly into numpy array out = np.empty_like(compare_arr) - codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1, out=out) + codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, out=out) compare_arrays(compare_arr, out, precision=precision) # test decoding directly into bytearray out = bytearray(compare_arr.nbytes) - codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, 1, out=out) + codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, out=out) # noinspection PyTypeChecker compare_arrays(compare_arr, out, precision=precision) From 45720cef082d378a09d4cd267d102c561ad9b481 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Thu, 11 Jun 2020 20:50:41 -0600 Subject: [PATCH 16/20] fix method docstring --- numcodecs/blosc.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 3cc406e6..91b0163a 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -578,11 +578,11 @@ class Blosc(Codec): return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) def decode(self, buf, out=None): - '''**Experimental**''' buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress(buf, out) def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): + '''**Experimental**''' buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return decompress_partial(buf, start, nitems, typesize, dest=out) From 15f482f63a04182a29d4815f500b45a505927a12 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Fri, 12 Jun 2020 10:04:07 -0600 Subject: [PATCH 17/20] removes debugging print statements --- numcodecs/blosc.pyx | 3 --- 1 file changed, 3 deletions(-) diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 91b0163a..86bb111d 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -445,9 +445,6 @@ def decompress_partial(source, start, nitems, typesize=0, dest=None): if typesize == 0: typesize = encoding_size - print(encoding_size) - print(typesize) - # convert varibles to handle type and encoding sizes nitems_bytes = nitems * typesize nitems_blosc = nitems_bytes // encoding_size From 4e3458258db6710366fe46df023eb619e4819cd2 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Wed, 1 Jul 2020 15:24:13 -0600 Subject: [PATCH 18/20] removes encoding_size argument from partial_decompression, updates tests --- numcodecs/blosc.c | 1439 +++++++++++-------------------------- numcodecs/blosc.pyx | 33 +- numcodecs/tests/common.py | 47 +- 3 files changed, 467 insertions(+), 1052 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index 3cb841e6..3e1c9e59 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -912,7 +912,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "numcodecs/blosc.pyx", - ".tox/py38/lib/python3.8/site-packages/Cython/Includes/cpython/type.pxd", + ".tox/py36/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd", "numcodecs/compat_ext.pxd", }; /* NoFastGil.proto */ @@ -1312,22 +1312,6 @@ 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); -/* PyIntCompare.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - -/* None.proto */ -static CYTHON_INLINE int __Pyx_div_int(int, int); - -/* UnaryNegOverflows.proto */ -#define UNARY_NEG_WOULD_OVERFLOW(x)\ - (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) - -/* None.proto */ -static CYTHON_INLINE int __Pyx_mod_int(int, int); - -/* 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); @@ -1556,7 +1540,6 @@ int __pyx_module_is_main_numcodecs__blosc = 0; static PyObject *__pyx_builtin_OSError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_print; static const char __pyx_k_[] = ","; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; @@ -1589,7 +1572,6 @@ static const char __pyx_k_cname[] = "cname"; 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_print[] = "print"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_Buffer[] = "Buffer"; @@ -1599,7 +1581,6 @@ static const char __pyx_k_clevel[] = "clevel"; static const char __pyx_k_compat[] = "compat"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; -static const char __pyx_k_format[] = "format"; static const char __pyx_k_getpid[] = "getpid"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; @@ -1647,7 +1628,6 @@ 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_blosc[] = "start_blosc"; 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__"; @@ -1660,7 +1640,6 @@ 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_blosc[] = "nitems_blosc"; 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"; @@ -1689,7 +1668,6 @@ 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_the_start_size_is_not_a_divisor[] = "the start size is not a divisor of the start offset bytes we want {} {} {}"; 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 "; static const char __pyx_k_bad_compressor_or_compressor_not[] = "bad compressor or compressor not supported: "; static const char __pyx_k_destination_buffer_too_small_exp[] = "destination buffer too small; expected at least "; @@ -1697,7 +1675,6 @@ static const char __pyx_k_error_during_blosc_compression_d[] = "error during blo 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 const char __pyx_k_the_encoding_size_is_not_a_divis[] = "the encoding size is not a divisor of the number of bytes we want"; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_AUTOBLOCKS; static PyObject *__pyx_n_s_AUTOSHUFFLE; @@ -1781,7 +1758,6 @@ 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; -static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_nthreads; static PyObject *__pyx_n_s_get_use_threads; static PyObject *__pyx_n_s_getpid; @@ -1807,7 +1783,6 @@ 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_blosc; static PyObject *__pyx_n_s_nitems_bytes; static PyObject *__pyx_n_s_nthreads; static PyObject *__pyx_n_s_numcodecs_blosc; @@ -1816,7 +1791,6 @@ static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_pid; static PyObject *__pyx_n_s_prepare; -static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_proc; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; @@ -1834,11 +1808,8 @@ 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_blosc; static PyObject *__pyx_n_s_start_bytes; static PyObject *__pyx_n_s_test; -static PyObject *__pyx_kp_u_the_encoding_size_is_not_a_divis; -static PyObject *__pyx_kp_u_the_start_size_is_not_a_divisor; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_typesize; static PyObject *__pyx_n_s_use_threads; @@ -1856,13 +1827,13 @@ 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_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_typesize, PyObject *__pyx_v_dest); /* 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_6decode_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf, int __pyx_v_start, int __pyx_v_nitems, int __pyx_v_typesize, PyObject *__pyx_v_out); /* 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; @@ -1889,6 +1860,7 @@ static PyObject *__pyx_tuple__35; 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; @@ -1907,7 +1879,7 @@ static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__39; -static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__42; /* Late includes */ /* "numcodecs/blosc.pyx":87 @@ -4666,35 +4638,31 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< + * 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_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, typesize=0, 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 dest : array-like, optional\n Object to decompress into.\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 typesize: int\n Size in number of bytes of the type we want to decode. \n encoding_size: int\n Size in number of bytes at the time of encoding\n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +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 dest : array-like, optional\n Object to decompress into.\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 encoding_size: int\n Size in number of bytes at the time of encoding\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_typesize = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __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_typesize,&__pyx_n_s_dest,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[3] = ((PyObject *)__pyx_int_0); - values[4] = ((PyObject *)Py_None); + 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 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); @@ -4715,25 +4683,19 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx 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, 5, 1); __PYX_ERR(0, 397, __pyx_L3_error) + __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, 5, 2); __PYX_ERR(0, 397, __pyx_L3_error) + __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_typesize); - if (value) { values[3] = value; kw_args--; } - } - CYTHON_FALLTHROUGH; - case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest); - if (value) { values[4] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -4741,8 +4703,6 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx } } 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); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4755,36 +4715,33 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_25decompress_partial(PyObject *__pyx __pyx_v_source = values[0]; __pyx_v_start = values[1]; __pyx_v_nitems = values[2]; - __pyx_v_typesize = values[3]; - __pyx_v_dest = values[4]; + __pyx_v_dest = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decompress_partial", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_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_typesize, __pyx_v_dest); + __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_24decompress_partial(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_start, PyObject *__pyx_v_nitems, PyObject *__pyx_v_typesize, PyObject *__pyx_v_dest) { +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; - int __pyx_v_nitems_blosc; - int __pyx_v_start_bytes; - int __pyx_v_start_blosc; + 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; + CYTHON_UNUSED size_t __pyx_v_dest_nbytes; PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4793,28 +4750,21 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P char *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - size_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_UCS4 __pyx_t_14; - int __pyx_t_15; - char const *__pyx_t_16; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; + size_t __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("decompress_partial", 0); - __Pyx_INCREF(__pyx_v_typesize); __Pyx_INCREF(__pyx_v_dest); - /* "numcodecs/blosc.pyx":436 + /* "numcodecs/blosc.pyx":434 * char *dest_ptr * Buffer source_buffer * Buffer dest_buffer = None # <<<<<<<<<<<<<< @@ -4824,16 +4774,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_INCREF(Py_None); __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); - /* "numcodecs/blosc.pyx":439 + /* "numcodecs/blosc.pyx":437 * * # 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, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyBUF_ANY_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); @@ -4841,13 +4791,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 439, __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, 437, __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":440 + /* "numcodecs/blosc.pyx":438 * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< @@ -4857,249 +4807,52 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_source_buffer->ptr; __pyx_v_source_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":443 + /* "numcodecs/blosc.pyx":441 * * # get encoding size from source buffer header * encoding_size = source[3] # <<<<<<<<<<<<<< - * # determine typesize if not given - * if typesize == 0: - */ - __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, 443, __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, 443, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_encoding_size = __pyx_t_4; - - /* "numcodecs/blosc.pyx":445 - * encoding_size = source[3] - * # determine typesize if not given - * if typesize == 0: # <<<<<<<<<<<<<< - * typesize = encoding_size * + * # convert varibles to handle type and encoding sizes */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_typesize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + __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, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "numcodecs/blosc.pyx":446 - * # determine typesize if not given - * if typesize == 0: - * typesize = encoding_size # <<<<<<<<<<<<<< - * - * print(encoding_size) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_typesize, __pyx_t_1); - __pyx_t_1 = 0; - - /* "numcodecs/blosc.pyx":445 - * encoding_size = source[3] - * # determine typesize if not given - * if typesize == 0: # <<<<<<<<<<<<<< - * typesize = encoding_size - * - */ - } + __pyx_v_encoding_size = __pyx_t_4; - /* "numcodecs/blosc.pyx":448 - * typesize = encoding_size - * - * print(encoding_size) # <<<<<<<<<<<<<< - * print(typesize) + /* "numcodecs/blosc.pyx":444 * + * # convert varibles to handle type and encoding sizes + * nitems_bytes = nitems * encoding_size # <<<<<<<<<<<<<< + * # nitems_blosc = nitems_bytes // 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, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_nitems, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "numcodecs/blosc.pyx":449 - * - * print(encoding_size) - * print(typesize) # <<<<<<<<<<<<<< - * - * # convert varibles to handle type and encoding sizes - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "numcodecs/blosc.pyx":452 - * - * # convert varibles to handle type and encoding sizes - * nitems_bytes = nitems * typesize # <<<<<<<<<<<<<< - * nitems_blosc = nitems_bytes // encoding_size - * start_bytes = (start * typesize) - */ - __pyx_t_2 = PyNumber_Multiply(__pyx_v_nitems, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nitems_bytes = __pyx_t_4; - /* "numcodecs/blosc.pyx":453 - * # convert varibles to handle type and encoding sizes - * nitems_bytes = nitems * typesize - * nitems_blosc = nitems_bytes // encoding_size # <<<<<<<<<<<<<< - * start_bytes = (start * typesize) - * start_blosc = start_bytes // encoding_size - */ - if (unlikely(__pyx_v_encoding_size == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 453, __pyx_L1_error) - } - else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_encoding_size == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_nitems_bytes))) { - PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 453, __pyx_L1_error) - } - __pyx_v_nitems_blosc = __Pyx_div_int(__pyx_v_nitems_bytes, __pyx_v_encoding_size); - - /* "numcodecs/blosc.pyx":454 - * nitems_bytes = nitems * typesize - * nitems_blosc = nitems_bytes // encoding_size - * start_bytes = (start * typesize) # <<<<<<<<<<<<<< - * start_blosc = start_bytes // encoding_size + /* "numcodecs/blosc.pyx":446 + * nitems_bytes = nitems * encoding_size + * # nitems_blosc = nitems_bytes // encoding_size + * start_bytes = (start * encoding_size) # <<<<<<<<<<<<<< + * # start_blosc = start_bytes // encoding_size * */ - __pyx_t_2 = PyNumber_Multiply(__pyx_v_start, __pyx_v_typesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __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, 446, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_start_bytes = __pyx_t_4; - /* "numcodecs/blosc.pyx":455 - * nitems_blosc = nitems_bytes // encoding_size - * start_bytes = (start * typesize) - * start_blosc = start_bytes // encoding_size # <<<<<<<<<<<<<< - * - * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" - */ - if (unlikely(__pyx_v_encoding_size == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 455, __pyx_L1_error) - } - else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_encoding_size == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_start_bytes))) { - PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 455, __pyx_L1_error) - } - __pyx_v_start_blosc = __Pyx_div_int(__pyx_v_start_bytes, __pyx_v_encoding_size); - - /* "numcodecs/blosc.pyx":457 - * start_blosc = start_bytes // encoding_size - * - * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" # <<<<<<<<<<<<<< - * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) - * - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(__pyx_v_encoding_size == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 457, __pyx_L1_error) - } - if (unlikely(!((__Pyx_mod_int(__pyx_v_nitems_bytes, __pyx_v_encoding_size) == 0) != 0))) { - PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_the_encoding_size_is_not_a_divis); - __PYX_ERR(0, 457, __pyx_L1_error) - } - } - #endif - - /* "numcodecs/blosc.pyx":458 - * - * assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" - * assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) # <<<<<<<<<<<<<< - * - * # setup destination buffer - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - if (unlikely(__pyx_v_encoding_size == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 458, __pyx_L1_error) - } - if (unlikely(!((__Pyx_mod_int(__pyx_v_start_bytes, __pyx_v_encoding_size) == 0) != 0))) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_start_blosc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__pyx_v_encoding_size == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 458, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyInt_From_int(__Pyx_mod_int(__pyx_v_start_blosc, __pyx_v_encoding_size)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_7, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_9) { - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8); - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyErr_SetObject(PyExc_AssertionError, __pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 458, __pyx_L1_error) - } - } - #endif - - /* "numcodecs/blosc.pyx":461 + /* "numcodecs/blosc.pyx":450 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -5107,22 +4860,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * dest_ptr = PyBytes_AS_STRING(dest) */ __pyx_t_5 = (__pyx_v_dest == Py_None); - __pyx_t_11 = (__pyx_t_5 != 0); - if (__pyx_t_11) { + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { - /* "numcodecs/blosc.pyx":462 + /* "numcodecs/blosc.pyx":451 * # 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, 462, __pyx_L1_error) + __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nitems_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dest, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":463 + /* "numcodecs/blosc.pyx":452 * if dest is None: * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -5131,7 +4884,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":464 + /* "numcodecs/blosc.pyx":453 * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< @@ -5140,17 +4893,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; - /* "numcodecs/blosc.pyx":461 + /* "numcodecs/blosc.pyx":450 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) */ - goto __pyx_L4; + goto __pyx_L3; } - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":455 * dest_nbytes = nitems_bytes * else: * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< @@ -5158,36 +4911,36 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * 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, 466, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { + __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_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_v_dest) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dest); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) + __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, 455, __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":467 + /* "numcodecs/blosc.pyx":456 * 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, 467, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int((PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -5195,13 +4948,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 467, __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, 456, __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":468 + /* "numcodecs/blosc.pyx":457 * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< @@ -5211,114 +4964,40 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_dest_buffer->ptr; __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":469 + /* "numcodecs/blosc.pyx":458 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< * * # try decompression */ - __pyx_t_12 = __pyx_v_dest_buffer->nbytes; - __pyx_v_dest_nbytes = __pyx_t_12; + __pyx_t_8 = __pyx_v_dest_buffer->nbytes; + __pyx_v_dest_nbytes = __pyx_t_8; } - __pyx_L4:; + __pyx_L3:; - /* "numcodecs/blosc.pyx":472 + /* "numcodecs/blosc.pyx":461 * * # try decompression * try: # <<<<<<<<<<<<<< - * if dest_nbytes < nitems_blosc: - * raise ValueError('destination buffer too small; expected at least %s, ' - */ - /*try:*/ { - - /* "numcodecs/blosc.pyx":473 - * # try decompression - * try: - * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< - * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems_blosc, dest_nbytes)) - */ - __pyx_t_11 = ((__pyx_v_dest_nbytes < __pyx_v_nitems_blosc) != 0); - if (unlikely(__pyx_t_11)) { - - /* "numcodecs/blosc.pyx":474 - * try: - * if dest_nbytes < nitems_blosc: - * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< - * 'got %s' % (nitems_blosc, dest_nbytes)) - * - */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = 0; - __pyx_t_14 = 127; - __Pyx_INCREF(__pyx_kp_u_destination_buffer_too_small_exp); - __pyx_t_13 += 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":475 - * if dest_nbytes < nitems_blosc: - * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems_blosc, dest_nbytes)) # <<<<<<<<<<<<<< - * - * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) - */ - __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_nitems_blosc, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 += __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_13 += 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, 475, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 += __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":474 - * try: - * if dest_nbytes < nitems_blosc: - * raise ValueError('destination buffer too small; expected at least %s, ' # <<<<<<<<<<<<<< - * 'got %s' % (nitems_blosc, dest_nbytes)) + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) * */ - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L6_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, 474, __pyx_L6_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, 474, __pyx_L6_error) + /*try:*/ { - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":462 * # try decompression * try: - * if dest_nbytes < nitems_blosc: # <<<<<<<<<<<<<< - * raise ValueError('destination buffer too small; expected at least %s, ' - * 'got %s' % (nitems_blosc, dest_nbytes)) - */ - } - - /* "numcodecs/blosc.pyx":477 - * 'got %s' % (nitems_blosc, dest_nbytes)) - * - * ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) # <<<<<<<<<<<<<< + * ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) # <<<<<<<<<<<<<< * * finally: */ - __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_v_start_blosc, __pyx_v_nitems_blosc, __pyx_v_dest_ptr); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L5_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_nitems); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L5_error) + __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_t_4, __pyx_t_9, __pyx_v_dest_ptr); } - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":465 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5327,33 +5006,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*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, 480, __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, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":466 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< * dest_buffer.release() * */ - __pyx_t_11 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); - __pyx_t_5 = (__pyx_t_11 != 0); + __pyx_t_6 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); + __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":482 + /* "numcodecs/blosc.pyx":467 * 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, 482, __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, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":466 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5361,43 +5040,39 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * */ } - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L6_error:; + __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_20); - __Pyx_XGOTREF(__pyx_t_21); - __Pyx_XGOTREF(__pyx_t_22); - __pyx_t_4 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_9 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { - /* "numcodecs/blosc.pyx":480 + /* "numcodecs/blosc.pyx":465 * * 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, 480, __pyx_L11_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, 465, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":466 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5405,21 +5080,21 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * */ __pyx_t_5 = (((PyObject *)__pyx_v_dest_buffer) != Py_None); - __pyx_t_11 = (__pyx_t_5 != 0); - if (__pyx_t_11) { + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { - /* "numcodecs/blosc.pyx":482 + /* "numcodecs/blosc.pyx":467 * 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, 482, __pyx_L11_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, 467, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":466 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5429,54 +5104,54 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } } if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_XGIVEREF(__pyx_t_22); - __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); - __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; - __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; - __pyx_L11_error:; + __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_XGIVEREF(__pyx_t_22); - __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } - __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; goto __pyx_L1_error; } - __pyx_L7:; + __pyx_L6:; } - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":470 * * # 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_11 = ((__pyx_v_ret <= 0) != 0); - if (unlikely(__pyx_t_11)) { + __pyx_t_6 = ((__pyx_v_ret <= 0) != 0); + if (unlikely(__pyx_t_6)) { - /* "numcodecs/blosc.pyx":486 + /* "numcodecs/blosc.pyx":471 * # 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, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __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); @@ -5484,14 +5159,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __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, 486, __pyx_L1_error) + __PYX_ERR(0, 471, __pyx_L1_error) - /* "numcodecs/blosc.pyx":485 + /* "numcodecs/blosc.pyx":470 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5500,7 +5175,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":488 + /* "numcodecs/blosc.pyx":473 * raise RuntimeError('error during blosc partial decompression: %d', ret) * * return dest # <<<<<<<<<<<<<< @@ -5515,7 +5190,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ @@ -5524,25 +5199,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); __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_typesize); __Pyx_XDECREF(__pyx_v_dest); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "numcodecs/blosc.pyx":496 +/* "numcodecs/blosc.pyx":481 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5578,16 +5248,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":498 + /* "numcodecs/blosc.pyx":483 * 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, 498, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __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, 498, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_current_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5602,27 +5272,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 498, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __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":501 + /* "numcodecs/blosc.pyx":486 * * # 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, 501, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_mutex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __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, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 486, __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":502 + /* "numcodecs/blosc.pyx":487 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5634,7 +5304,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":501 + /* "numcodecs/blosc.pyx":486 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5643,25 +5313,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":505 + /* "numcodecs/blosc.pyx":490 * * # 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, 505, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __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, 505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_importer_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __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, 505, __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, 490, __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, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":509 + /* "numcodecs/blosc.pyx":494 * # 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 # <<<<<<<<<<<<<< @@ -5673,7 +5343,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":505 + /* "numcodecs/blosc.pyx":490 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5682,25 +5352,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":511 + /* "numcodecs/blosc.pyx":496 * 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, 511, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __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, 511, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 511, __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, 496, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 496, __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, 511, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 511, __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, 496, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L6_bool_binop_done:; @@ -5708,19 +5378,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":513 + /* "numcodecs/blosc.pyx":498 * 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, 513, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__use_threads = __pyx_t_2; __pyx_t_2 = 0; - /* "numcodecs/blosc.pyx":511 + /* "numcodecs/blosc.pyx":496 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5730,7 +5400,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":522 + /* "numcodecs/blosc.pyx":507 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5738,13 +5408,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 522, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __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, 522, __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, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":523 + /* "numcodecs/blosc.pyx":508 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5754,7 +5424,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":522 + /* "numcodecs/blosc.pyx":507 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5764,30 +5434,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":524 + /* "numcodecs/blosc.pyx":509 * 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, 524, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __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, 524, __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, 509, __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":525 + /* "numcodecs/blosc.pyx":510 * _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, 525, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __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, 525, __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, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5802,12 +5472,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 525, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __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, 525, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __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, 525, __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, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5822,16 +5492,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 525, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __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, 525, __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, 510, __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":524 + /* "numcodecs/blosc.pyx":509 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5841,7 +5511,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":527 + /* "numcodecs/blosc.pyx":512 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5849,9 +5519,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 527, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __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, 527, __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, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -5866,13 +5536,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 527, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __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, 527, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __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, 527, __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, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v__use_threads = __pyx_t_6; __pyx_t_6 = 0; @@ -5881,7 +5551,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":529 + /* "numcodecs/blosc.pyx":514 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5893,7 +5563,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":496 + /* "numcodecs/blosc.pyx":481 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5917,7 +5587,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":566 +/* "numcodecs/blosc.pyx":551 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5932,7 +5602,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 566, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)__pyx_n_u_lz4)); __Pyx_GIVEREF(((PyObject*)__pyx_n_u_lz4)); @@ -5946,7 +5616,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 566, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -6039,7 +5709,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, 566, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 551, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6064,7 +5734,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, 566, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 551, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6087,16 +5757,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "numcodecs/blosc.pyx":567 + /* "numcodecs/blosc.pyx":552 * * 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, 567, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 552, __pyx_L1_error) - /* "numcodecs/blosc.pyx":568 + /* "numcodecs/blosc.pyx":553 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6107,14 +5777,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":569 + /* "numcodecs/blosc.pyx":554 * 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, 569, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -6128,13 +5798,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, 569, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __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, 569, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "numcodecs/blosc.pyx":568 + /* "numcodecs/blosc.pyx":553 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -6144,7 +5814,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":571 + /* "numcodecs/blosc.pyx":556 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -6152,38 +5822,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, 571, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cname_bytes, __pyx_v_cname) < 0) __PYX_ERR(0, 556, __pyx_L1_error) } __pyx_L3:; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":557 * 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, 572, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clevel, __pyx_v_clevel) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - /* "numcodecs/blosc.pyx":573 + /* "numcodecs/blosc.pyx":558 * 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, 573, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 558, __pyx_L1_error) - /* "numcodecs/blosc.pyx":574 + /* "numcodecs/blosc.pyx":559 * 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, 574, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blocksize, __pyx_v_blocksize) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - /* "numcodecs/blosc.pyx":566 + /* "numcodecs/blosc.pyx":551 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -6206,7 +5876,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":576 +/* "numcodecs/blosc.pyx":561 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6247,11 +5917,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, 576, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, 1); __PYX_ERR(0, 561, __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, 576, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "encode") < 0)) __PYX_ERR(0, 561, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -6264,7 +5934,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, 576, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("encode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6292,16 +5962,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("encode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":577 + /* "numcodecs/blosc.pyx":562 * * 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, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __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, 577, __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, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6318,7 +5988,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, 577, __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_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6327,14 +5997,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, 577, __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_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, 577, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __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; @@ -6345,7 +6015,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, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6353,7 +6023,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":578 + /* "numcodecs/blosc.pyx":563 * 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) # <<<<<<<<<<<<<< @@ -6361,15 +6031,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, 578, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __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, 578, __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, 563, __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, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __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, 578, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __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, 578, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -6386,7 +6056,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, 578, __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, 563, __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; @@ -6398,7 +6068,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, 578, __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, 563, __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; @@ -6408,7 +6078,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, 578, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __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; @@ -6428,7 +6098,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, 578, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6437,7 +6107,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":561 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6464,17 +6134,17 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":580 +/* "numcodecs/blosc.pyx":565 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< - * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress(buf, out) */ /* Python wrapper */ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_9numcodecs_5blosc_5Blosc_4decode[] = "Blosc.decode(self, buf, out=None)\n**Experimental**"; +static char __pyx_doc_9numcodecs_5blosc_5Blosc_4decode[] = "Blosc.decode(self, buf, out=None)"; static PyMethodDef __pyx_mdef_9numcodecs_5blosc_5Blosc_5decode = {"decode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9numcodecs_5blosc_5Blosc_5decode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9numcodecs_5blosc_5Blosc_4decode}; static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_5decode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; @@ -6509,7 +6179,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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 565, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6519,7 +6189,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, 580, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode") < 0)) __PYX_ERR(0, 565, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6537,7 +6207,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, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 565, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("numcodecs.blosc.Blosc.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6562,16 +6232,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("decode", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":582 + /* "numcodecs/blosc.pyx":566 + * * def decode(self, buf, out=None): - * '''**Experimental**''' * 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, 582, __pyx_L1_error) + __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, 582, __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, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6588,7 +6258,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, 582, __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, 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; @@ -6597,14 +6267,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, 582, __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, 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, 582, __pyx_L1_error) + __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; @@ -6615,7 +6285,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, 582, __pyx_L1_error) + __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; } @@ -6623,15 +6293,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":583 - * '''**Experimental**''' + /* "numcodecs/blosc.pyx":567 + * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): + * 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, 583, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decompress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; @@ -6648,7 +6318,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, 583, __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, 567, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6656,13 +6326,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, 583, __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, 567, __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, 583, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __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; @@ -6673,7 +6343,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, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -6682,12 +6352,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":565 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< - * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress(buf, out) */ /* function exit code */ @@ -6706,38 +6376,35 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":585 +/* "numcodecs/blosc.pyx":569 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< + * 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, */ /* 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, int typesize=0, out=None)"; +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; - int __pyx_v_typesize; 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_typesize,&__pyx_n_s_out,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - values[5] = ((PyObject *)((PyObject *)Py_None)); + 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 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -6760,40 +6427,32 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p 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, 6, 1); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 1); __PYX_ERR(0, 569, __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, 6, 2); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 2); __PYX_ERR(0, 569, __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, 6, 3); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 3); __PYX_ERR(0, 569, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typesize); - if (value) { values[4] = value; kw_args--; } - } - CYTHON_FALLTHROUGH; - case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); - if (value) { values[5] = value; kw_args--; } + 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, 585, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 569, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -6806,31 +6465,26 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 585, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - if (values[4]) { - __pyx_v_typesize = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_typesize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) - } else { - __pyx_v_typesize = ((int)((int)0)); - } - __pyx_v_out = values[5]; + __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + __pyx_v_out = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 569, __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_typesize, __pyx_v_out); + __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, int __pyx_v_typesize, PyObject *__pyx_v_out) { +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; @@ -6842,16 +6496,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":586 - * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): + /* "numcodecs/blosc.pyx":571 + * 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, - * typesize, dest=out) + * 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, 586, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_contiguous_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __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, 586, __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, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6868,7 +6522,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 586, __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, 571, __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; @@ -6877,14 +6531,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 586, __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, 571, __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, 586, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __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; @@ -6895,7 +6549,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 586, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -6903,86 +6557,49 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":587 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): + /* "numcodecs/blosc.pyx":572 + * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, dest=out) + * 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, 587, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decompress_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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, 587, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __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, 587, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - - /* "numcodecs/blosc.pyx":588 - * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, - * typesize, dest=out) # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typesize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - - /* "numcodecs/blosc.pyx":587 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): - * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, dest=out) - * - */ - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_buf); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buf); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_6 = 0; - __pyx_t_3 = 0; - - /* "numcodecs/blosc.pyx":588 - * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, - * typesize, dest=out) # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dest, __pyx_v_out) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - - /* "numcodecs/blosc.pyx":587 - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): - * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) - * return decompress_partial(buf, start, nitems, # <<<<<<<<<<<<<< - * typesize, dest=out) - * - */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __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, 572, __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, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 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":585 + /* "numcodecs/blosc.pyx":569 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< + * 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, */ /* function exit code */ @@ -7001,8 +6618,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":590 - * typesize, dest=out) +/* "numcodecs/blosc.pyx":574 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -7036,28 +6653,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":591 + /* "numcodecs/blosc.pyx":575 * * 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, 591, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; - /* "numcodecs/blosc.pyx":592 + /* "numcodecs/blosc.pyx":576 * 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, 592, __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, 576, __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, 592, __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, 576, __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; @@ -7070,16 +6687,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":593 + /* "numcodecs/blosc.pyx":577 * 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, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __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, 593, __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, 577, __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; @@ -7092,16 +6709,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":594 + /* "numcodecs/blosc.pyx":578 * (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, 594, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __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, 594, __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, 578, __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; @@ -7114,25 +6731,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":595 + /* "numcodecs/blosc.pyx":579 * 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, 595, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shuffle_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __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, 595, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __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, 595, __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, 579, __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, 595, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __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, 595, __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, 579, __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; @@ -7145,15 +6762,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":596 + /* "numcodecs/blosc.pyx":580 * 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, 596, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __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, 596, __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, 580, __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; @@ -7166,20 +6783,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":591 + /* "numcodecs/blosc.pyx":575 * * 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, 591, __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, 575, __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":597 + /* "numcodecs/blosc.pyx":581 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -7189,8 +6806,8 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":590 - * typesize, dest=out) + /* "numcodecs/blosc.pyx":574 + * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< * r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ @@ -7341,7 +6958,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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}, - {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_nthreads, __pyx_k_get_nthreads, sizeof(__pyx_k_get_nthreads), 0, 0, 1, 1}, {&__pyx_n_s_get_use_threads, __pyx_k_get_use_threads, sizeof(__pyx_k_get_use_threads), 0, 0, 1, 1}, {&__pyx_n_s_getpid, __pyx_k_getpid, sizeof(__pyx_k_getpid), 0, 0, 1, 1}, @@ -7367,7 +6983,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_blosc, __pyx_k_nitems_blosc, sizeof(__pyx_k_nitems_blosc), 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}, @@ -7376,7 +6991,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_proc, __pyx_k_proc, sizeof(__pyx_k_proc), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, @@ -7394,11 +7008,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__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_blosc, __pyx_k_start_blosc, sizeof(__pyx_k_start_blosc), 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_kp_u_the_encoding_size_is_not_a_divis, __pyx_k_the_encoding_size_is_not_a_divis, sizeof(__pyx_k_the_encoding_size_is_not_a_divis), 0, 1, 0, 0}, - {&__pyx_kp_u_the_start_size_is_not_a_divisor, __pyx_k_the_start_size_is_not_a_divisor, sizeof(__pyx_k_the_start_size_is_not_a_divisor), 0, 1, 0, 0}, {&__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}, {&__pyx_n_s_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 1}, @@ -7410,7 +7021,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __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) - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 448, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7569,89 +7179,92 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ - __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_source, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_dest, __pyx_n_s_ret, __pyx_n_s_encoding_size, __pyx_n_s_nitems_bytes, __pyx_n_s_nitems_blosc, __pyx_n_s_start_bytes, __pyx_n_s_start_blosc, __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_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(5, 0, 17, 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) + __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":496 + /* "numcodecs/blosc.pyx":481 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 496, __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, 481, __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, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 496, __pyx_L1_error) + __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, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 481, __pyx_L1_error) - /* "numcodecs/blosc.pyx":566 + /* "numcodecs/blosc.pyx":551 * 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__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, 566, __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, 551, __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, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 566, __pyx_L1_error) + __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, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 551, __pyx_L1_error) - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":561 * 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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 576, __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, 561, __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, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 576, __pyx_L1_error) + __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, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 561, __pyx_L1_error) - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":565 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< - * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) + * return decompress(buf, out) */ - __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, 580, __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, 565, __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, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 580, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 580, __pyx_L1_error) + __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, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":569 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< + * 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, */ - __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_start, __pyx_n_s_nitems, __pyx_n_s_typesize, __pyx_n_s_out); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 585, __pyx_L1_error) + __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, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 585, __pyx_L1_error) + __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, 569, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); - /* "numcodecs/blosc.pyx":590 - * typesize, dest=out) + /* "numcodecs/blosc.pyx":574 + * 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__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_numcodecs_blosc_pyx, __pyx_n_s_repr, 590, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 590, __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, 574, __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, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8524,7 +8137,7 @@ if (!__Pyx_RefNanny) { /* "numcodecs/blosc.pyx":397 * * - * def decompress_partial(source, start, nitems, typesize=0, dest=None): # <<<<<<<<<<<<<< + * def decompress_partial(source, start, nitems, dest=None): # <<<<<<<<<<<<<< * """**Experimental** * Decompress data of only a part of a buffer. */ @@ -8533,35 +8146,35 @@ if (!__Pyx_RefNanny) { 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":493 + /* "numcodecs/blosc.pyx":478 * # 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, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 478, __pyx_L1_error) - /* "numcodecs/blosc.pyx":496 + /* "numcodecs/blosc.pyx":481 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 496, __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, 481, __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, 496, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_7) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":532 + /* "numcodecs/blosc.pyx":517 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_u_AUTOSHUFFLE); __Pyx_GIVEREF(__pyx_n_u_AUTOSHUFFLE); @@ -8575,38 +8188,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, 532, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle_repr, __pyx_t_7) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "numcodecs/blosc.pyx":535 + /* "numcodecs/blosc.pyx":520 * * * 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, 535, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __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, 535, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __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, 535, __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, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "numcodecs/blosc.pyx":559 + /* "numcodecs/blosc.pyx":544 * """ * * 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, 559, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_codec_id, __pyx_n_u_blosc) < 0) __PYX_ERR(0, 544, __pyx_L1_error) - /* "numcodecs/blosc.pyx":560 + /* "numcodecs/blosc.pyx":545 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8614,12 +8227,12 @@ if (!__Pyx_RefNanny) { * BITSHUFFLE = BITSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __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, 560, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_NOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":561 + /* "numcodecs/blosc.pyx":546 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8627,12 +8240,12 @@ if (!__Pyx_RefNanny) { * AUTOSHUFFLE = AUTOSHUFFLE */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_SHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __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, 561, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_SHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":562 + /* "numcodecs/blosc.pyx":547 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8640,12 +8253,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, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __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, 562, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_BITSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":563 + /* "numcodecs/blosc.pyx":548 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8653,120 +8266,109 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 548, __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, 563, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_AUTOSHUFFLE, __pyx_t_8) < 0) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":564 + /* "numcodecs/blosc.pyx":549 * 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, 564, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_max_buffer_size, __pyx_int_2147483647) < 0) __PYX_ERR(0, 549, __pyx_L1_error) - /* "numcodecs/blosc.pyx":566 + /* "numcodecs/blosc.pyx":551 * 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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __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, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 566, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 551, __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, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 551, __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, 566, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AUTOBLOCKS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 551, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":576 + /* "numcodecs/blosc.pyx":561 * 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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 576, __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, 561, __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, 576, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_encode, __pyx_t_8) < 0) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":580 + /* "numcodecs/blosc.pyx":565 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< - * '''**Experimental**''' * 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__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __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, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 580, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":585 + /* "numcodecs/blosc.pyx":569 * return decompress(buf, out) * - * def decode_partial(self, buf, int start, int nitems, int typesize=0, out=None): # <<<<<<<<<<<<<< + * 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, */ - __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); - __Pyx_INCREF(((PyObject *)Py_None)); - __Pyx_GIVEREF(((PyObject *)Py_None)); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)Py_None)); - __pyx_t_8 = 0; - __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, 585, __pyx_L1_error) + __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, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_9); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode_partial, __pyx_t_8) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __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, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":590 - * typesize, dest=out) + /* "numcodecs/blosc.pyx":574 + * 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_9__repr__, 0, __pyx_n_s_Blosc___repr, NULL, __pyx_n_s_numcodecs_blosc, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __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, 574, __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, 590, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_8) < 0) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "numcodecs/blosc.pyx":535 + /* "numcodecs/blosc.pyx":520 * * * 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, 535, __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, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blosc, __pyx_t_8) < 0) __PYX_ERR(0, 520, __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; @@ -10072,177 +9674,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -/* PyIntCompare */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { - if (op1 == op2) { - Py_RETURN_TRUE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = Py_SIZE(op1); - const digit* digits = ((PyLongObject*)op1)->ob_digit; - if (intval == 0) { - if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } else if (intval < 0) { - if (size >= 0) - Py_RETURN_FALSE; - intval = -intval; - size = -size; - } else { - if (size <= 0) - Py_RETURN_FALSE; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - return ( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - -/* None */ -static CYTHON_INLINE int __Pyx_div_int(int a, int b) { - int q = a / b; - int r = a - q*b; - q -= ((r != 0) & ((r ^ b) < 0)); - return q; -} - -/* None */ -static CYTHON_INLINE int __Pyx_mod_int(int a, int b) { - int r = a % b; - r += ((r != 0) & ((r ^ b) < 0)) * b; - return r; -} - -/* 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_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; - int remaining; -#ifdef GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 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 = (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 = (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 = (int) (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); -} - /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index 86bb111d..d073428c 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -394,7 +394,7 @@ def decompress(source, dest=None): return dest -def decompress_partial(source, start, nitems, typesize=0, dest=None): +def decompress_partial(source, start, nitems, dest=None): """**Experimental** Decompress data of only a part of a buffer. @@ -409,8 +409,6 @@ def decompress_partial(source, start, nitems, typesize=0, dest=None): Offset in item where we want to start decoding nitems: int Number of items we want to decode - typesize: int - Size in number of bytes of the type we want to decode. encoding_size: int Size in number of bytes at the time of encoding @@ -427,9 +425,9 @@ def decompress_partial(source, start, nitems, typesize=0, dest=None): int ret int encoding_size int nitems_bytes - int nitems_blosc + #int nitems_blosc int start_bytes - int start_blosc + #int start_blosc char *source_ptr char *dest_ptr Buffer source_buffer @@ -441,18 +439,12 @@ def decompress_partial(source, start, nitems, typesize=0, dest=None): # get encoding size from source buffer header encoding_size = source[3] - # determine typesize if not given - if typesize == 0: - typesize = encoding_size # convert varibles to handle type and encoding sizes - nitems_bytes = nitems * typesize - nitems_blosc = nitems_bytes // encoding_size - start_bytes = (start * typesize) - start_blosc = start_bytes // encoding_size - - assert nitems_bytes % encoding_size == 0, "the encoding size is not a divisor of the number of bytes we want" - assert start_bytes % encoding_size == 0, "the start size is not a divisor of the start offset bytes we want {} {} {}".format(start_blosc, encoding_size, start_blosc % encoding_size) + nitems_bytes = nitems * encoding_size + # nitems_blosc = nitems_bytes // encoding_size + start_bytes = (start * encoding_size) + # start_blosc = start_bytes // encoding_size # setup destination buffer if dest is None: @@ -467,11 +459,7 @@ def decompress_partial(source, start, nitems, typesize=0, dest=None): # try decompression try: - if dest_nbytes < nitems_blosc: - raise ValueError('destination buffer too small; expected at least %s, ' - 'got %s' % (nitems_blosc, dest_nbytes)) - - ret = blosc_getitem(source_ptr, start_blosc, nitems_blosc, dest_ptr) + ret = blosc_getitem(source_ptr, start, nitems, dest_ptr) finally: source_buffer.release() @@ -578,11 +566,10 @@ 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, int typesize=0, out=None): + 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, - typesize, dest=out) + return decompress_partial(buf, start, nitems, dest=out) def __repr__(self): r = '%s(cname=%r, clevel=%r, shuffle=%s, blocksize=%s)' % \ diff --git a/numcodecs/tests/common.py b/numcodecs/tests/common.py index e8c7b949..c914e33e 100644 --- a/numcodecs/tests/common.py +++ b/numcodecs/tests/common.py @@ -120,9 +120,7 @@ def check_encode_decode_partial(arr, codec, precision=None): # we just require that the results of the encode/decode round-trip can # be compared to the original array. - # encoding should support any object exporting the buffer protocol - - ITEMSIZE = arr.dtype.itemsize + itemsize = arr.itemsize start, nitems = 5, 10 compare_arr = arr[start:start+nitems] # test encoding of numpy array @@ -130,55 +128,54 @@ def check_encode_decode_partial(arr, codec, precision=None): dec = codec.decode_partial(enc, start, nitems) compare_arrays(compare_arr, dec, precision=precision) - # test encoding of bytes + # 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, nitems, ITEMSIZE) + dec = codec.decode_partial(enc, start*itemsize, nitems*itemsize, out=out) compare_arrays(compare_arr, dec, precision=precision) - # test encoding of bytearray + # test partial decode of encoded bytearray buf = bytearray(arr.tobytes(order='A')) enc = codec.encode(buf) - dec = codec.decode_partial(enc, start, nitems, ITEMSIZE) + dec = codec.decode_partial(enc, start*itemsize, nitems*itemsize, out=out) compare_arrays(compare_arr, dec, precision=precision) - # test encoding of array.array + # 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, nitems, ITEMSIZE) + 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, + # # decoding should support any object exporting the buffer protocol, - # setup + # # setup enc_bytes = ensure_bytes(enc) - # test decoding of raw bytes - dec = codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE) + # 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 decoding of bytearray - dec = codec.decode_partial(bytearray(enc_bytes), start, nitems, ITEMSIZE) + # 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 decoding of array.array + # test partial decoding of array.array buf = array.array('b', enc_bytes) - dec = codec.decode_partial(buf, start, nitems, ITEMSIZE) + dec = codec.decode_partial(buf, start*itemsize, nitems*itemsize, out=out) compare_arrays(compare_arr, dec, precision=precision) - # test decoding of numpy array + # test decoding of numpy array into numpy array buf = np.frombuffer(enc_bytes, dtype='u1') - dec = codec.decode_partial(buf, start, nitems, ITEMSIZE) + dec = codec.decode_partial(buf, start*itemsize, nitems*itemsize, out=out) compare_arrays(compare_arr, dec, precision=precision) - # test decoding directly into numpy array - out = np.empty_like(compare_arr) - codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, out=out) - compare_arrays(compare_arr, out, precision=precision) - # test decoding directly into bytearray out = bytearray(compare_arr.nbytes) - codec.decode_partial(enc_bytes, start, nitems, ITEMSIZE, out=out) + codec.decode_partial(enc_bytes, start*itemsize, nitems*itemsize, out=out) # noinspection PyTypeChecker compare_arrays(compare_arr, out, precision=precision) From 4cbfe5c05c6671522f083a45da9842de8ff6eef9 Mon Sep 17 00:00:00 2001 From: Andrew Fulton Date: Sun, 5 Jul 2020 12:21:50 -0600 Subject: [PATCH 19/20] fixes up formatting of docstrings. Adds check that destination buffer is the right size --- numcodecs/blosc.c | 810 +++++++++++++++++++++++++++----------------- numcodecs/blosc.pyx | 17 +- 2 files changed, 496 insertions(+), 331 deletions(-) diff --git a/numcodecs/blosc.c b/numcodecs/blosc.c index 3e1c9e59..c9e13dbe 100644 --- a/numcodecs/blosc.c +++ b/numcodecs/blosc.c @@ -1312,6 +1312,9 @@ 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); @@ -4645,7 +4648,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_22decompress(CYTHON_UNUSED PyObject /* Python wrapper */ 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 dest : array-like, optional\n Object to decompress into.\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 encoding_size: int\n Size in number of bytes at the time of encoding\n\n Returns\n -------\n dest : bytes\n Object containing decompressed data.\n\n "; +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; @@ -4741,7 +4744,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P 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; - CYTHON_UNUSED size_t __pyx_v_dest_nbytes; + size_t __pyx_v_dest_nbytes; PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4753,18 +4756,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P int __pyx_t_6; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; - int __pyx_t_9; - char const *__pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; + 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":434 + /* "numcodecs/blosc.pyx":428 * char *dest_ptr * Buffer source_buffer * Buffer dest_buffer = None # <<<<<<<<<<<<<< @@ -4774,16 +4779,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __Pyx_INCREF(Py_None); __pyx_v_dest_buffer = ((struct __pyx_obj_9numcodecs_10compat_ext_Buffer *)Py_None); - /* "numcodecs/blosc.pyx":437 + /* "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, 437, __pyx_L1_error) + __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, 437, __pyx_L1_error) + __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); @@ -4791,13 +4796,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 437, __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, 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":438 + /* "numcodecs/blosc.pyx":432 * # setup source buffer * source_buffer = Buffer(source, PyBUF_ANY_CONTIGUOUS) * source_ptr = source_buffer.ptr # <<<<<<<<<<<<<< @@ -4807,52 +4812,52 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_source_buffer->ptr; __pyx_v_source_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":441 + /* "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, 441, __pyx_L1_error) + __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, 441, __pyx_L1_error) + __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":444 + /* "numcodecs/blosc.pyx":438 * * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * encoding_size # <<<<<<<<<<<<<< - * # nitems_blosc = nitems_bytes // 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, 444, __pyx_L1_error) + __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, 444, __pyx_L1_error) + __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, 444, __pyx_L1_error) + __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":446 + /* "numcodecs/blosc.pyx":439 + * # convert varibles to handle type and encoding sizes * nitems_bytes = nitems * encoding_size - * # nitems_blosc = nitems_bytes // encoding_size * start_bytes = (start * encoding_size) # <<<<<<<<<<<<<< - * # start_blosc = start_bytes // encoding_size * + * # setup destination buffer */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_encoding_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __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, 446, __pyx_L1_error) + __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, 446, __pyx_L1_error) + __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":450 + /* "numcodecs/blosc.pyx":442 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -4863,19 +4868,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "numcodecs/blosc.pyx":451 + /* "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, 451, __pyx_L1_error) + __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":452 + /* "numcodecs/blosc.pyx":444 * if dest is None: * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) # <<<<<<<<<<<<<< @@ -4884,7 +4889,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_ptr = PyBytes_AS_STRING(__pyx_v_dest); - /* "numcodecs/blosc.pyx":453 + /* "numcodecs/blosc.pyx":445 * dest = PyBytes_FromStringAndSize(NULL, nitems_bytes) * dest_ptr = PyBytes_AS_STRING(dest) * dest_nbytes = nitems_bytes # <<<<<<<<<<<<<< @@ -4893,7 +4898,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ __pyx_v_dest_nbytes = __pyx_v_nitems_bytes; - /* "numcodecs/blosc.pyx":450 + /* "numcodecs/blosc.pyx":442 * * # setup destination buffer * if dest is None: # <<<<<<<<<<<<<< @@ -4903,7 +4908,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P goto __pyx_L3; } - /* "numcodecs/blosc.pyx":455 + /* "numcodecs/blosc.pyx":447 * dest_nbytes = nitems_bytes * else: * arr = ensure_contiguous_ndarray(dest) # <<<<<<<<<<<<<< @@ -4911,7 +4916,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P * 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, 455, __pyx_L1_error) + __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))) { @@ -4925,22 +4930,22 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } __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, 455, __pyx_L1_error) + 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":456 + /* "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, 456, __pyx_L1_error) + __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, 456, __pyx_L1_error) + __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); @@ -4948,13 +4953,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 456, __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, 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":457 + /* "numcodecs/blosc.pyx":449 * arr = ensure_contiguous_ndarray(dest) * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr # <<<<<<<<<<<<<< @@ -4964,7 +4969,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_3 = __pyx_v_dest_buffer->ptr; __pyx_v_dest_ptr = __pyx_t_3; - /* "numcodecs/blosc.pyx":458 + /* "numcodecs/blosc.pyx":450 * dest_buffer = Buffer(arr, PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE) * dest_ptr = dest_buffer.ptr * dest_nbytes = dest_buffer.nbytes # <<<<<<<<<<<<<< @@ -4976,28 +4981,104 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } __pyx_L3:; - /* "numcodecs/blosc.pyx":461 + /* "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) * */ - /*try:*/ { + __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":462 + /* "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, 462, __pyx_L5_error) - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_nitems); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L5_error) - __pyx_v_ret = blosc_getitem(__pyx_v_source_ptr, __pyx_t_4, __pyx_t_9, __pyx_v_dest_ptr); + __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":465 + /* "numcodecs/blosc.pyx":460 * * finally: * source_buffer.release() # <<<<<<<<<<<<<< @@ -5006,11 +5087,11 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ /*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, 465, __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, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":461 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5021,18 +5102,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { - /* "numcodecs/blosc.pyx":467 + /* "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, 467, __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, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":461 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5046,33 +5127,33 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __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_14, &__pyx_t_15, &__pyx_t_16); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_12); + 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_t_9 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + __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":465 + /* "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, 465, __pyx_L9_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, 460, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":461 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5083,18 +5164,18 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "numcodecs/blosc.pyx":467 + /* "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, 467, __pyx_L9_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, 462, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":466 + /* "numcodecs/blosc.pyx":461 * finally: * source_buffer.release() * if dest_buffer is not None: # <<<<<<<<<<<<<< @@ -5104,35 +5185,35 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P } } if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __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_11); - __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_10; + __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_L9_error:; + __pyx_L10_error:; if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __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_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 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":470 + /* "numcodecs/blosc.pyx":465 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5142,16 +5223,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __pyx_t_6 = ((__pyx_v_ret <= 0) != 0); if (unlikely(__pyx_t_6)) { - /* "numcodecs/blosc.pyx":471 + /* "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, 471, __pyx_L1_error) + __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, 471, __pyx_L1_error) + __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); @@ -5159,14 +5240,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P __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, 471, __pyx_L1_error) + __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, 471, __pyx_L1_error) + __PYX_ERR(0, 466, __pyx_L1_error) - /* "numcodecs/blosc.pyx":470 + /* "numcodecs/blosc.pyx":465 * * # ret refers to the number of bytes returned from blosc_getitem. * if ret <= 0: # <<<<<<<<<<<<<< @@ -5175,7 +5256,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P */ } - /* "numcodecs/blosc.pyx":473 + /* "numcodecs/blosc.pyx":468 * raise RuntimeError('error during blosc partial decompression: %d', ret) * * return dest # <<<<<<<<<<<<<< @@ -5212,7 +5293,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_24decompress_partial(CYTHON_UNUSED P return __pyx_r; } -/* "numcodecs/blosc.pyx":481 +/* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5248,16 +5329,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_use_threads", 0); - /* "numcodecs/blosc.pyx":483 + /* "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, 483, __pyx_L1_error) + __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, 483, __pyx_L1_error) + __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; @@ -5272,27 +5353,27 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 483, __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":486 + /* "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, 486, __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, 486, __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":487 + /* "numcodecs/blosc.pyx":482 * # check if locks are available, and if not no threads * if not mutex: * return False # <<<<<<<<<<<<<< @@ -5304,7 +5385,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":486 + /* "numcodecs/blosc.pyx":481 * * # check if locks are available, and if not no threads * if not mutex: # <<<<<<<<<<<<<< @@ -5313,25 +5394,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":490 + /* "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, 490, __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, 490, __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, 490, __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, 490, __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":494 + /* "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 # <<<<<<<<<<<<<< @@ -5343,7 +5424,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = Py_False; goto __pyx_L0; - /* "numcodecs/blosc.pyx":490 + /* "numcodecs/blosc.pyx":485 * * # check for fork * if proc.pid != _importer_pid: # <<<<<<<<<<<<<< @@ -5352,25 +5433,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO */ } - /* "numcodecs/blosc.pyx":496 + /* "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, 496, __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, 496, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 496, __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, 496, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 496, __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:; @@ -5378,19 +5459,19 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "numcodecs/blosc.pyx":498 + /* "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, 498, __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":496 + /* "numcodecs/blosc.pyx":491 * return False * * if use_threads in [True, False]: # <<<<<<<<<<<<<< @@ -5400,7 +5481,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L5; } - /* "numcodecs/blosc.pyx":507 + /* "numcodecs/blosc.pyx":502 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5408,13 +5489,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 507, __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, 507, __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":508 + /* "numcodecs/blosc.pyx":503 * * if proc.name != 'MainProcess': * _use_threads = False # <<<<<<<<<<<<<< @@ -5424,7 +5505,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __Pyx_INCREF(Py_False); __pyx_v__use_threads = Py_False; - /* "numcodecs/blosc.pyx":507 + /* "numcodecs/blosc.pyx":502 * # program or multi-process program * * if proc.name != 'MainProcess': # <<<<<<<<<<<<<< @@ -5434,30 +5515,30 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":509 + /* "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, 509, __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, 509, __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":510 + /* "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, 510, __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, 510, __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; @@ -5472,12 +5553,12 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 510, __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, 510, __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, 510, __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; @@ -5492,16 +5573,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 510, __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, 510, __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":509 + /* "numcodecs/blosc.pyx":504 * if proc.name != 'MainProcess': * _use_threads = False * elif hasattr(threading, 'main_thread'): # <<<<<<<<<<<<<< @@ -5511,7 +5592,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO goto __pyx_L8; } - /* "numcodecs/blosc.pyx":512 + /* "numcodecs/blosc.pyx":507 * _use_threads = (threading.main_thread() == threading.current_thread()) * else: * _use_threads = threading.current_thread().name == 'MainThread' # <<<<<<<<<<<<<< @@ -5519,9 +5600,9 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 512, __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, 512, __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; @@ -5536,13 +5617,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_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, 512, __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, 512, __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, 512, __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; @@ -5551,7 +5632,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO } __pyx_L5:; - /* "numcodecs/blosc.pyx":514 + /* "numcodecs/blosc.pyx":509 * _use_threads = threading.current_thread().name == 'MainThread' * * return _use_threads # <<<<<<<<<<<<<< @@ -5563,7 +5644,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO __pyx_r = __pyx_v__use_threads; goto __pyx_L0; - /* "numcodecs/blosc.pyx":481 + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< @@ -5587,7 +5668,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_26_get_use_threads(CYTHON_UNUSED PyO return __pyx_r; } -/* "numcodecs/blosc.pyx":551 +/* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5602,7 +5683,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__defaults__(CYTHON_UNUSED PyObjec 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, 551, __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)); @@ -5616,7 +5697,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_28__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, 551, __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); @@ -5709,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, 551, __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)) { @@ -5734,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, 551, __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(); @@ -5757,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":552 + /* "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, 552, __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":553 + /* "numcodecs/blosc.pyx":548 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5777,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":554 + /* "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, 554, __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))) { @@ -5798,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, 554, __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, 554, __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":553 + /* "numcodecs/blosc.pyx":548 * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): * self.cname = cname * if isinstance(cname, str): # <<<<<<<<<<<<<< @@ -5814,7 +5895,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "numcodecs/blosc.pyx":556 + /* "numcodecs/blosc.pyx":551 * self._cname_bytes = cname.encode('ascii') * else: * self._cname_bytes = cname # <<<<<<<<<<<<<< @@ -5822,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, 556, __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":557 + /* "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, 557, __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":558 + /* "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, 558, __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":559 + /* "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, 559, __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":551 + /* "numcodecs/blosc.pyx":546 * max_buffer_size = 2**31 - 1 * * def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS): # <<<<<<<<<<<<<< @@ -5876,7 +5957,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc___init__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "numcodecs/blosc.pyx":561 +/* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -5917,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, 561, __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, 561, __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; @@ -5934,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, 561, __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(); @@ -5962,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":562 + /* "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, 562, __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, 562, __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; @@ -5988,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, 562, __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; @@ -5997,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, 562, __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, 562, __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; @@ -6015,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, 562, __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; } @@ -6023,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":563 + /* "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) # <<<<<<<<<<<<<< @@ -6031,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, 563, __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, 563, __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, 563, __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, 563, __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, 563, __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; @@ -6056,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, 563, __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; @@ -6068,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, 563, __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; @@ -6078,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, 563, __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; @@ -6098,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, 563, __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; } @@ -6107,7 +6188,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":561 + /* "numcodecs/blosc.pyx":556 * self.blocksize = blocksize * * def encode(self, buf): # <<<<<<<<<<<<<< @@ -6134,7 +6215,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_2encode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":565 +/* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6179,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, 565, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode", 0, 2, 3, 1); __PYX_ERR(0, 560, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6189,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, 565, __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)) { @@ -6207,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, 565, __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(); @@ -6232,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":566 + /* "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, 566, __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, 566, __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; @@ -6258,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, 566, __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; @@ -6267,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, 566, __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, 566, __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; @@ -6285,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, 566, __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; } @@ -6293,7 +6374,7 @@ 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":567 + /* "numcodecs/blosc.pyx":562 * def decode(self, buf, out=None): * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress(buf, out) # <<<<<<<<<<<<<< @@ -6301,7 +6382,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec * 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, 567, __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; @@ -6318,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, 567, __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 @@ -6326,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, 567, __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, 567, __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; @@ -6343,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, 567, __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; } @@ -6352,7 +6433,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":565 + /* "numcodecs/blosc.pyx":560 * return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize) * * def decode(self, buf, out=None): # <<<<<<<<<<<<<< @@ -6376,7 +6457,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_4decode(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "numcodecs/blosc.pyx":569 +/* "numcodecs/blosc.pyx":564 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< @@ -6427,19 +6508,19 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p 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, 569, __pyx_L3_error) + __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, 569, __pyx_L3_error) + __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, 569, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("decode_partial", 0, 4, 5, 3); __PYX_ERR(0, 564, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -6449,7 +6530,7 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_partial") < 0)) __PYX_ERR(0, 569, __pyx_L3_error) + 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)) { @@ -6465,13 +6546,13 @@ static PyObject *__pyx_pw_9numcodecs_5blosc_5Blosc_7decode_partial(PyObject *__p } __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, 569, __pyx_L3_error) - __pyx_v_nitems = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nitems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + __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, 569, __pyx_L3_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(); @@ -6496,16 +6577,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_RefNannySetupContext("decode_partial", 0); __Pyx_INCREF(__pyx_v_buf); - /* "numcodecs/blosc.pyx":571 + /* "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, 571, __pyx_L1_error) + __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, 571, __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, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -6522,7 +6603,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 571, __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, 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; @@ -6531,14 +6612,14 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED #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, 571, __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, 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, 571, __pyx_L1_error) + __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; @@ -6549,7 +6630,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __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, 571, __pyx_L1_error) + __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; } @@ -6557,7 +6638,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_1); __pyx_t_1 = 0; - /* "numcodecs/blosc.pyx":572 + /* "numcodecs/blosc.pyx":567 * '''**Experimental**''' * buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) * return decompress_partial(buf, start, nitems, dest=out) # <<<<<<<<<<<<<< @@ -6565,13 +6646,13 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED * 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, 572, __pyx_L1_error) + __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, 572, __pyx_L1_error) + __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, 572, __pyx_L1_error) + __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, 572, __pyx_L1_error) + __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); @@ -6582,10 +6663,10 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED 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, 572, __pyx_L1_error) + __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, 572, __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, 572, __pyx_L1_error) + 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; @@ -6594,7 +6675,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED __pyx_t_2 = 0; goto __pyx_L0; - /* "numcodecs/blosc.pyx":569 + /* "numcodecs/blosc.pyx":564 * return decompress(buf, out) * * def decode_partial(self, buf, int start, int nitems, out=None): # <<<<<<<<<<<<<< @@ -6618,7 +6699,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_6decode_partial(CYTHON_UNUSED return __pyx_r; } -/* "numcodecs/blosc.pyx":574 +/* "numcodecs/blosc.pyx":569 * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -6653,28 +6734,28 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); - /* "numcodecs/blosc.pyx":575 + /* "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, 575, __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":576 + /* "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, 576, __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, 576, __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; @@ -6687,16 +6768,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":577 + /* "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, 577, __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, 577, __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; @@ -6709,16 +6790,16 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":578 + /* "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, 578, __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, 578, __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; @@ -6731,25 +6812,25 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":579 + /* "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, 579, __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, 579, __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, 579, __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, 579, __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, 579, __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; @@ -6762,15 +6843,15 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__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":580 + /* "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, 580, __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, 580, __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; @@ -6783,20 +6864,20 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__5); - /* "numcodecs/blosc.pyx":575 + /* "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, 575, __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":581 + /* "numcodecs/blosc.pyx":576 * _shuffle_repr[self.shuffle + 1], * self.blocksize) * return r # <<<<<<<<<<<<<< @@ -6806,7 +6887,7 @@ static PyObject *__pyx_pf_9numcodecs_5blosc_5Blosc_8__repr__(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_r; goto __pyx_L0; - /* "numcodecs/blosc.pyx":574 + /* "numcodecs/blosc.pyx":569 * return decompress_partial(buf, start, nitems, dest=out) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7188,83 +7269,83 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __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":481 + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_proc, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 481, __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, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 481, __pyx_L1_error) + __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":551 + /* "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__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, 551, __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, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 551, __pyx_L1_error) + __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":561 + /* "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__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 561, __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, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 561, __pyx_L1_error) + __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":565 + /* "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__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_out); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 565, __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, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 565, __pyx_L1_error) - __pyx_tuple__37 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 565, __pyx_L1_error) + __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":569 + /* "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, 569, __pyx_L1_error) + __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, 569, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 569, __pyx_L1_error) - __pyx_tuple__40 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 569, __pyx_L1_error) + __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":574 + /* "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__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 574, __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, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 574, __pyx_L1_error) + __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:; @@ -8146,35 +8227,35 @@ if (!__Pyx_RefNanny) { 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":478 + /* "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, 478, __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":481 + /* "numcodecs/blosc.pyx":476 * * * def _get_use_threads(): # <<<<<<<<<<<<<< * global use_threads * proc = multiprocessing.current_process() */ - __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, 481, __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, 481, __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":517 + /* "numcodecs/blosc.pyx":512 * * * _shuffle_repr = ['AUTOSHUFFLE', 'NOSHUFFLE', 'SHUFFLE', 'BITSHUFFLE'] # <<<<<<<<<<<<<< * * */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __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); @@ -8188,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, 517, __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":520 + /* "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, 520, __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, 520, __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, 520, __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, 520, __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":544 + /* "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, 544, __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":545 + /* "numcodecs/blosc.pyx":540 * * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE # <<<<<<<<<<<<<< @@ -8227,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, 545, __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, 545, __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":546 + /* "numcodecs/blosc.pyx":541 * codec_id = 'blosc' * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE # <<<<<<<<<<<<<< @@ -8240,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, 546, __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, 546, __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":547 + /* "numcodecs/blosc.pyx":542 * NOSHUFFLE = NOSHUFFLE * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE # <<<<<<<<<<<<<< @@ -8253,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, 547, __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, 547, __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":548 + /* "numcodecs/blosc.pyx":543 * SHUFFLE = SHUFFLE * BITSHUFFLE = BITSHUFFLE * AUTOSHUFFLE = AUTOSHUFFLE # <<<<<<<<<<<<<< @@ -8266,109 +8347,109 @@ if (!__Pyx_RefNanny) { * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AUTOSHUFFLE); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 548, __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, 548, __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":549 + /* "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, 549, __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":551 + /* "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__32)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __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, 551, __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, 551, __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, 551, __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_28__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_8) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + 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":561 + /* "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__34)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __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, 561, __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":565 + /* "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__36)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __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__37); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_decode, __pyx_t_8) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + 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":569 + /* "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, 569, __pyx_L1_error) + __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, 569, __pyx_L1_error) + 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":574 + /* "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_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, 574, __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, 574, __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":520 + /* "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, 520, __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, 520, __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; @@ -9674,6 +9755,95 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } +/* 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_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; + int remaining; +#ifdef GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 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 = (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 = (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 = (int) (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); +} + /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx index d073428c..3bfdc00c 100644 --- a/numcodecs/blosc.pyx +++ b/numcodecs/blosc.pyx @@ -403,14 +403,13 @@ def decompress_partial(source, start, nitems, dest=None): source : bytes-like Compressed data, including blosc header. Can be any object supporting the buffer protocol. - dest : array-like, optional - Object to decompress into. start: int, Offset in item where we want to start decoding nitems: int Number of items we want to decode - encoding_size: int - Size in number of bytes at the time of encoding + dest : array-like, optional + Object to decompress into. + Returns ------- @@ -418,16 +417,11 @@ def decompress_partial(source, start, nitems, dest=None): Object containing decompressed data. """ - # we do need both the typesize and the encoding size as nitems will be - # interpreted by blosc wrt the size of the item. - cdef: int ret int encoding_size int nitems_bytes - #int nitems_blosc int start_bytes - #int start_blosc char *source_ptr char *dest_ptr Buffer source_buffer @@ -442,9 +436,7 @@ def decompress_partial(source, start, nitems, dest=None): # convert varibles to handle type and encoding sizes nitems_bytes = nitems * encoding_size - # nitems_blosc = nitems_bytes // encoding_size start_bytes = (start * encoding_size) - # start_blosc = start_bytes // encoding_size # setup destination buffer if dest is None: @@ -459,6 +451,9 @@ def decompress_partial(source, start, nitems, dest=None): # 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: From 73017f4fb108ed055bf6b80486a148a9348f2cb9 Mon Sep 17 00:00:00 2001 From: Alistair Miles Date: Wed, 8 Jul 2020 20:48:04 +0100 Subject: [PATCH 20/20] Update docs/release.rst --- docs/release.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 4a316b99..35cf36f5 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -4,8 +4,8 @@ Release notes Upcoming Release ---------------- -* Add partial decompression of Blosc compressed arrays - By :user:`Andrew Fulton ` +* Add partial decompression of Blosc compressed arrays. + By :user:`Andrew Fulton `, :issue:`235`. * Remove LegacyJSON codec. By :user:`James Bourbeau `, :issue:`226`.