@@ -34,7 +34,6 @@ def __init__(self, array, out_dtype=None)
34
34
from .casting import (int_to_float , as_int , int_abs , type_info , floor_exact ,
35
35
best_float , shared_range )
36
36
from .volumeutils import finite_range , array_to_file
37
- from .deprecator import ExpiredDeprecationError
38
37
39
38
40
39
class WriterError (Exception ):
@@ -185,38 +184,22 @@ def finite_range(self):
185
184
self ._has_nan = has_nan
186
185
return self ._finite_range
187
186
188
- def _check_nan2zero (self , nan2zero ):
189
- if nan2zero is None :
190
- return
191
- if nan2zero != self ._nan2zero :
192
- raise WriterError ('Deprecated `nan2zero` argument to `to_fileobj` '
193
- 'must be same as class value set in __init__' )
194
- raise ExpiredDeprecationError (
195
- 'Please remove `nan2zero` from call to `to_fileobj` '
196
- 'and use in instance __init__ instead.\n '
197
- '* deprecated in version: 2.0\n '
198
- '* Raises ExpiredDeprecationError as of version: 4.0\n '
199
- )
200
-
201
187
def _needs_nan2zero (self ):
202
188
""" True if nan2zero check needed for writing array """
203
189
return (self ._nan2zero and
204
190
self ._array .dtype .kind in 'fc' and
205
191
self .out_dtype .kind in 'iu' and
206
192
self .has_nan )
207
193
208
- def to_fileobj (self , fileobj , order = 'F' , nan2zero = None ):
194
+ def to_fileobj (self , fileobj , order = 'F' ):
209
195
""" Write array into `fileobj`
210
196
211
197
Parameters
212
198
----------
213
199
fileobj : file-like object
214
200
order : {'F', 'C'}
215
201
order (Fortran or C) to which to write array
216
- nan2zero : {None, True, False}, optional, deprecated
217
- Deprecated version of argument to __init__ with same name
218
202
"""
219
- self ._check_nan2zero (nan2zero )
220
203
array_to_file (self ._array ,
221
204
fileobj ,
222
205
self ._out_dtype ,
@@ -362,18 +345,15 @@ def _writing_range(self):
362
345
return mn , mx
363
346
return None , None
364
347
365
- def to_fileobj (self , fileobj , order = 'F' , nan2zero = None ):
348
+ def to_fileobj (self , fileobj , order = 'F' ):
366
349
""" Write array into `fileobj`
367
350
368
351
Parameters
369
352
----------
370
353
fileobj : file-like object
371
354
order : {'F', 'C'}
372
355
order (Fortran or C) to which to write array
373
- nan2zero : {None, True, False}, optional, deprecated
374
- Deprecated version of argument to __init__ with same name
375
356
"""
376
- self ._check_nan2zero (nan2zero )
377
357
mn , mx = self ._writing_range ()
378
358
array_to_file (self ._array ,
379
359
fileobj ,
@@ -536,18 +516,15 @@ def _set_inter(self, val):
536
516
self ._inter = np .squeeze (self .scaler_dtype .type (val ))
537
517
inter = property (_get_inter , _set_inter , None , 'get/set inter' )
538
518
539
- def to_fileobj (self , fileobj , order = 'F' , nan2zero = None ):
519
+ def to_fileobj (self , fileobj , order = 'F' ):
540
520
""" Write array into `fileobj`
541
521
542
522
Parameters
543
523
----------
544
524
fileobj : file-like object
545
525
order : {'F', 'C'}
546
526
order (Fortran or C) to which to write array
547
- nan2zero : {None, True, False}, optional, deprecated
548
- Deprecated version of argument to __init__ with same name
549
527
"""
550
- self ._check_nan2zero (nan2zero )
551
528
mn , mx = self ._writing_range ()
552
529
array_to_file (self ._array ,
553
530
fileobj ,
0 commit comments