Skip to content

Commit 8b3cc16

Browse files
committed
Fix deprecations
1 parent 6b4d914 commit 8b3cc16

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

numcodecs/blosc.pyx

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ def _init():
100100
"""Initialize the Blosc library environment."""
101101
blosc_init()
102102

103-
init = deprecated("init is deprecated, with no replacement")(_init)
103+
104+
@deprecated("init is deprecated, with no replacement")
105+
def init():
106+
return _init()
104107

105108

106109
def _destroy():
@@ -119,7 +122,10 @@ def _compname_to_compcode(cname):
119122
cname = cname.encode('ascii')
120123
return blosc_compname_to_compcode(cname)
121124

122-
compname_to_compcode = deprecated("compname_to_compcode is deprecated, with no replacement")(_compname_to_compcode)
125+
126+
@deprecated("compname_to_compcode is deprecated, with no replacement")
127+
def compname_to_compcode(cname):
128+
return _compname_to_compcode(cname)
123129

124130

125131
def list_compressors():
@@ -168,7 +174,9 @@ def _cbuffer_sizes(source):
168174

169175
return nbytes, cbytes, blocksize
170176

171-
cbuffer_sizes = deprecated(_cbuffer_sizes)
177+
@deprecated("cbuffer_sizes is deprecated with no replacement")
178+
def cbuffer_sizes(source):
179+
return _cbuffer_sizes(source)
172180

173181
def cbuffer_complib(source):
174182
"""Return the name of the compression library used to compress `source`."""
@@ -226,13 +234,21 @@ def _cbuffer_metainfo(source):
226234

227235
return typesize, shuffle, memcpyed
228236

229-
cbuffer_metainfo = deprecated("cbuffer_metainfo is deprecated, with no replacement")(_cbuffer_metainfo)
237+
238+
@deprecated("cbuffer_metainfo is deprecated, with no replacement")
239+
def cbuffer_metainfo(source):
240+
return _cbuffer_metainfo(source)
241+
230242

231243
def _err_bad_cname(cname):
232244
raise ValueError('bad compressor or compressor not supported: %r; expected one of '
233245
'%s' % (cname, list_compressors()))
234246

235-
err_bad_cname = deprecated("err_bad_cname is deprecated, with no replacement")(_err_bad_cname)
247+
248+
@deprecated("err_bad_cname is deprecated, with no replacement")
249+
def err_bad_cname(cname):
250+
return _err_bad_cname(cname)
251+
236252

237253
def compress(source, char* cname, int clevel, int shuffle=SHUFFLE,
238254
int blocksize=AUTOBLOCKS):
@@ -489,7 +505,9 @@ def _decompress_partial(source, start, nitems, dest=None):
489505

490506
return dest
491507

492-
decompress_partial = deprecated("decompress_partial is deprecated, with no replacement")(_decompress_partial)
508+
@deprecated("decompress_partial is deprecated, with no replacement")
509+
def decompress_partial(source, start, nitems, dest=None):
510+
return _decompress_partial(source, start, nitems, dest=None)
493511

494512
# set the value of this variable to True or False to override the
495513
# default adaptive behaviour

0 commit comments

Comments
 (0)