6
6
import threading
7
7
import multiprocessing
8
8
import os
9
+ from deprecated import deprecated
9
10
10
11
11
12
from cpython.buffer cimport PyBUF_ANY_CONTIGUOUS, PyBUF_WRITEABLE
@@ -86,24 +87,31 @@ except ImportError:
86
87
_importer_pid = os.getpid()
87
88
88
89
89
- def init ():
90
+ def _init ():
90
91
""" Initialize the Blosc library environment."""
91
92
blosc_init()
92
93
94
+ init = deprecated(_init)
93
95
94
- def destroy ():
96
+
97
+ def _destroy ():
95
98
""" Destroy the Blosc library environment."""
96
99
blosc_destroy()
97
100
98
101
99
- def compname_to_compcode (cname ):
102
+ destroy = deprecated(_destroy)
103
+
104
+
105
+ def _compname_to_compcode (cname ):
100
106
""" Return the compressor code associated with the compressor name. If the compressor
101
107
name is not recognized, or there is not support for it in this build, -1 is returned
102
108
instead."""
103
109
if isinstance (cname, str ):
104
110
cname = cname.encode(' ascii' )
105
111
return blosc_compname_to_compcode(cname)
106
112
113
+ compname_to_compcode = deprecated(_compname_to_compcode)
114
+
107
115
108
116
def list_compressors ():
109
117
""" Get a list of compressors supported in the current build."""
@@ -124,7 +132,7 @@ def set_nthreads(int nthreads):
124
132
return blosc_set_nthreads(nthreads)
125
133
126
134
127
- def cbuffer_sizes (source ):
135
+ def _cbuffer_sizes (source ):
128
136
""" Return information about a compressed buffer, namely the number of uncompressed
129
137
bytes (`nbytes`) and compressed (`cbytes`). It also returns the `blocksize` (which
130
138
is used internally for doing the compression by blocks).
@@ -151,6 +159,7 @@ def cbuffer_sizes(source):
151
159
152
160
return nbytes, cbytes, blocksize
153
161
162
+ cbuffer_sizes = deprecated(_cbuffer_sizes)
154
163
155
164
def cbuffer_complib (source ):
156
165
""" Return the name of the compression library used to compress `source`."""
@@ -171,7 +180,7 @@ def cbuffer_complib(source):
171
180
return complib
172
181
173
182
174
- def cbuffer_metainfo (source ):
183
+ def _cbuffer_metainfo (source ):
175
184
""" Return some meta-information about the compressed buffer in `source`, including
176
185
the typesize, whether the shuffle or bit-shuffle filters were used, and the
177
186
whether the buffer was memcpyed.
@@ -208,11 +217,13 @@ def cbuffer_metainfo(source):
208
217
209
218
return typesize, shuffle, memcpyed
210
219
220
+ cbuffer_metainfo = deprecated(_cbuffer_metainfo)
211
221
212
222
def err_bad_cname (cname ):
213
223
raise ValueError (' bad compressor or compressor not supported: %r ; expected one of '
214
224
' %s ' % (cname, list_compressors()))
215
225
226
+ err_bad_cname = deprecated(_err_bad_cname)
216
227
217
228
def compress (source , char* cname , int clevel , int shuffle = SHUFFLE,
218
229
int blocksize = AUTOBLOCKS):
@@ -396,7 +407,7 @@ def decompress(source, dest=None):
396
407
return dest
397
408
398
409
399
- def decompress_partial (source , start , nitems , dest = None ):
410
+ def _decompress_partial (source , start , nitems , dest = None ):
400
411
""" **Experimental**
401
412
Decompress data of only a part of a buffer.
402
413
@@ -469,6 +480,7 @@ def decompress_partial(source, start, nitems, dest=None):
469
480
470
481
return dest
471
482
483
+ decompress_partial = deprecated(_decompress_partial)
472
484
473
485
# set the value of this variable to True or False to override the
474
486
# default adaptive behaviour
0 commit comments