66import threading
77import multiprocessing
88import os
9+ from deprecated import deprecated
910
1011
1112from cpython.buffer cimport PyBUF_ANY_CONTIGUOUS, PyBUF_WRITEABLE
@@ -95,24 +96,31 @@ def get_mutex():
9596_importer_pid = os.getpid()
9697
9798
98- def init ():
99+ def _init ():
99100 """ Initialize the Blosc library environment."""
100101 blosc_init()
101102
103+ init = deprecated(_init)
102104
103- def destroy ():
105+
106+ def _destroy ():
104107 """ Destroy the Blosc library environment."""
105108 blosc_destroy()
106109
107110
108- def compname_to_compcode (cname ):
111+ destroy = deprecated(_destroy)
112+
113+
114+ def _compname_to_compcode (cname ):
109115 """ Return the compressor code associated with the compressor name. If the compressor
110116 name is not recognized, or there is not support for it in this build, -1 is returned
111117 instead."""
112118 if isinstance (cname, str ):
113119 cname = cname.encode(' ascii' )
114120 return blosc_compname_to_compcode(cname)
115121
122+ compname_to_compcode = deprecated(_compname_to_compcode)
123+
116124
117125def list_compressors ():
118126 """ Get a list of compressors supported in the current build."""
@@ -133,7 +141,7 @@ def set_nthreads(int nthreads):
133141 return blosc_set_nthreads(nthreads)
134142
135143
136- def cbuffer_sizes (source ):
144+ def _cbuffer_sizes (source ):
137145 """ Return information about a compressed buffer, namely the number of uncompressed
138146 bytes (`nbytes`) and compressed (`cbytes`). It also returns the `blocksize` (which
139147 is used internally for doing the compression by blocks).
@@ -160,6 +168,7 @@ def cbuffer_sizes(source):
160168
161169 return nbytes, cbytes, blocksize
162170
171+ cbuffer_sizes = deprecated(_cbuffer_sizes)
163172
164173def cbuffer_complib (source ):
165174 """ Return the name of the compression library used to compress `source`."""
@@ -180,7 +189,7 @@ def cbuffer_complib(source):
180189 return complib
181190
182191
183- def cbuffer_metainfo (source ):
192+ def _cbuffer_metainfo (source ):
184193 """ Return some meta-information about the compressed buffer in `source`, including
185194 the typesize, whether the shuffle or bit-shuffle filters were used, and the
186195 whether the buffer was memcpyed.
@@ -217,11 +226,13 @@ def cbuffer_metainfo(source):
217226
218227 return typesize, shuffle, memcpyed
219228
229+ cbuffer_metainfo = deprecated(_cbuffer_metainfo)
220230
221- def err_bad_cname (cname ):
231+ def _err_bad_cname (cname ):
222232 raise ValueError (' bad compressor or compressor not supported: %r ; expected one of '
223233 ' %s ' % (cname, list_compressors()))
224234
235+ err_bad_cname = deprecated(_err_bad_cname)
225236
226237def compress (source , char* cname , int clevel , int shuffle = SHUFFLE,
227238 int blocksize = AUTOBLOCKS):
@@ -405,7 +416,7 @@ def decompress(source, dest=None):
405416 return dest
406417
407418
408- def decompress_partial (source , start , nitems , dest = None ):
419+ def _decompress_partial (source , start , nitems , dest = None ):
409420 """ **Experimental**
410421 Decompress data of only a part of a buffer.
411422
@@ -478,6 +489,7 @@ def decompress_partial(source, start, nitems, dest=None):
478489
479490 return dest
480491
492+ decompress_partial = deprecated(_decompress_partial)
481493
482494# set the value of this variable to True or False to override the
483495# default adaptive behaviour
0 commit comments