66import threading
77import multiprocessing
88import os
9+ from deprecated import deprecated
910
1011
1112from cpython.buffer cimport PyBUF_ANY_CONTIGUOUS, PyBUF_WRITEABLE
@@ -86,24 +87,31 @@ except ImportError:
8687_importer_pid = os.getpid()
8788
8889
89- def init ():
90+ def _init ():
9091 """ Initialize the Blosc library environment."""
9192 blosc_init()
9293
94+ init = deprecated(_init)
9395
94- def destroy ():
96+
97+ def _destroy ():
9598 """ Destroy the Blosc library environment."""
9699 blosc_destroy()
97100
98101
99- def compname_to_compcode (cname ):
102+ destroy = deprecated(_destroy)
103+
104+
105+ def _compname_to_compcode (cname ):
100106 """ Return the compressor code associated with the compressor name. If the compressor
101107 name is not recognized, or there is not support for it in this build, -1 is returned
102108 instead."""
103109 if isinstance (cname, str ):
104110 cname = cname.encode(' ascii' )
105111 return blosc_compname_to_compcode(cname)
106112
113+ compname_to_compcode = deprecated(_compname_to_compcode)
114+
107115
108116def list_compressors ():
109117 """ Get a list of compressors supported in the current build."""
@@ -124,7 +132,7 @@ def set_nthreads(int nthreads):
124132 return blosc_set_nthreads(nthreads)
125133
126134
127- def cbuffer_sizes (source ):
135+ def _cbuffer_sizes (source ):
128136 """ Return information about a compressed buffer, namely the number of uncompressed
129137 bytes (`nbytes`) and compressed (`cbytes`). It also returns the `blocksize` (which
130138 is used internally for doing the compression by blocks).
@@ -151,6 +159,7 @@ def cbuffer_sizes(source):
151159
152160 return nbytes, cbytes, blocksize
153161
162+ cbuffer_sizes = deprecated(_cbuffer_sizes)
154163
155164def cbuffer_complib (source ):
156165 """ Return the name of the compression library used to compress `source`."""
@@ -171,7 +180,7 @@ def cbuffer_complib(source):
171180 return complib
172181
173182
174- def cbuffer_metainfo (source ):
183+ def _cbuffer_metainfo (source ):
175184 """ Return some meta-information about the compressed buffer in `source`, including
176185 the typesize, whether the shuffle or bit-shuffle filters were used, and the
177186 whether the buffer was memcpyed.
@@ -208,11 +217,13 @@ def cbuffer_metainfo(source):
208217
209218 return typesize, shuffle, memcpyed
210219
220+ cbuffer_metainfo = deprecated(_cbuffer_metainfo)
211221
212- def err_bad_cname (cname ):
222+ def _err_bad_cname (cname ):
213223 raise ValueError (' bad compressor or compressor not supported: %r ; expected one of '
214224 ' %s ' % (cname, list_compressors()))
215225
226+ err_bad_cname = deprecated(_err_bad_cname)
216227
217228def compress (source , char* cname , int clevel , int shuffle = SHUFFLE,
218229 int blocksize = AUTOBLOCKS):
@@ -396,7 +407,7 @@ def decompress(source, dest=None):
396407 return dest
397408
398409
399- def decompress_partial (source , start , nitems , dest = None ):
410+ def _decompress_partial (source , start , nitems , dest = None ):
400411 """ **Experimental**
401412 Decompress data of only a part of a buffer.
402413
@@ -469,6 +480,7 @@ def decompress_partial(source, start, nitems, dest=None):
469480
470481 return dest
471482
483+ decompress_partial = deprecated(_decompress_partial)
472484
473485# set the value of this variable to True or False to override the
474486# default adaptive behaviour
0 commit comments