@@ -473,7 +473,7 @@ def __call__(self, X, alpha=None, bytes=False):
473473 # Treat 1.0 as slightly less than 1.
474474 vals = np .array ([1 , 0 ], dtype = xa .dtype )
475475 almost_one = np .nextafter (* vals )
476- cbook . _putmask (xa , xa == 1.0 , almost_one )
476+ np . copyto (xa , almost_one , where = xa == 1.0 )
477477 # The following clip is fast, and prevents possible
478478 # conversion of large positive values to negative integers.
479479
@@ -482,15 +482,15 @@ def __call__(self, X, alpha=None, bytes=False):
482482
483483 # ensure that all 'under' values will still have negative
484484 # value after casting to int
485- cbook . _putmask (xa , xa < 0.0 , - 1 )
485+ np . copyto (xa , - 1 , where = xa < 0.0 )
486486 xa = xa .astype (int )
487487 # Set the over-range indices before the under-range;
488488 # otherwise the under-range values get converted to over-range.
489- cbook . _putmask (xa , xa > self .N - 1 , self . _i_over )
490- cbook . _putmask (xa , xa < 0 , self . _i_under )
489+ np . copyto (xa , self . _i_over , where = xa > self .N - 1 )
490+ np . copyto (xa , self . _i_under , where = xa < 0 )
491491 if mask_bad is not None :
492492 if mask_bad .shape == xa .shape :
493- cbook . _putmask (xa , mask_bad , self ._i_bad )
493+ np . copyto (xa , self ._i_bad , where = mask_bad )
494494 elif mask_bad :
495495 xa .fill (self ._i_bad )
496496 if bytes :
@@ -990,7 +990,7 @@ def __call__(self, value, clip=None):
990990 mask = (resdat <= 0 )
991991 else :
992992 mask |= resdat <= 0
993- cbook . _putmask (resdat , mask , 1 )
993+ np . copyto (resdat , 1 , where = mask )
994994 np .log (resdat , resdat )
995995 resdat -= np .log (vmin )
996996 resdat /= (np .log (vmax ) - np .log (vmin ))
0 commit comments