@@ -213,14 +213,15 @@ def __str__(self):
213213 return "{}(base={}, nonpositive={!r})" .format (
214214 type (self ).__name__ , self .base , "clip" if self ._clip else "mask" )
215215
216- def transform_non_affine (self , a ):
216+ @_api .rename_parameter ("3.8" , "a" , "values" )
217+ def transform_non_affine (self , values ):
217218 # Ignore invalid values due to nans being passed to the transform.
218219 with np .errstate (divide = "ignore" , invalid = "ignore" ):
219220 log = {np .e : np .log , 2 : np .log2 , 10 : np .log10 }.get (self .base )
220221 if log : # If possible, do everything in a single call to NumPy.
221- out = log (a )
222+ out = log (values )
222223 else :
223- out = np .log (a )
224+ out = np .log (values )
224225 out /= np .log (self .base )
225226 if self ._clip :
226227 # SVG spec says that conforming viewers must support values up
@@ -232,7 +233,7 @@ def transform_non_affine(self, a):
232233 # pass. On the other hand, in practice, we want to clip beyond
233234 # np.log10(np.nextafter(0, 1)) ~ -323
234235 # so 1000 seems safe.
235- out [a <= 0 ] = - 1000
236+ out [values <= 0 ] = - 1000
236237 return out
237238
238239 def inverted (self ):
@@ -249,8 +250,9 @@ def __init__(self, base):
249250 def __str__ (self ):
250251 return f"{ type (self ).__name__ } (base={ self .base } )"
251252
252- def transform_non_affine (self , a ):
253- return np .power (self .base , a )
253+ @_api .rename_parameter ("3.8" , "a" , "values" )
254+ def transform_non_affine (self , values ):
255+ return np .power (self .base , values )
254256
255257 def inverted (self ):
256258 return LogTransform (self .base )
@@ -360,14 +362,15 @@ def __init__(self, base, linthresh, linscale):
360362 self ._linscale_adj = (linscale / (1.0 - self .base ** - 1 ))
361363 self ._log_base = np .log (base )
362364
363- def transform_non_affine (self , a ):
364- abs_a = np .abs (a )
365+ @_api .rename_parameter ("3.8" , "a" , "values" )
366+ def transform_non_affine (self , values ):
367+ abs_a = np .abs (values )
365368 with np .errstate (divide = "ignore" , invalid = "ignore" ):
366- out = np .sign (a ) * self .linthresh * (
369+ out = np .sign (values ) * self .linthresh * (
367370 self ._linscale_adj +
368371 np .log (abs_a / self .linthresh ) / self ._log_base )
369372 inside = abs_a <= self .linthresh
370- out [inside ] = a [inside ] * self ._linscale_adj
373+ out [inside ] = values [inside ] * self ._linscale_adj
371374 return out
372375
373376 def inverted (self ):
@@ -387,19 +390,20 @@ def __init__(self, base, linthresh, linscale):
387390 self .linscale = linscale
388391 self ._linscale_adj = (linscale / (1.0 - self .base ** - 1 ))
389392
390- def transform_non_affine (self , a ):
391- abs_a = np .abs (a )
393+ @_api .rename_parameter ("3.8" , "a" , "values" )
394+ def transform_non_affine (self , values ):
395+ abs_a = np .abs (values )
392396 if (abs_a < self .linthresh ).all ():
393397 _api .warn_external (
394398 "All values for SymLogScale are below linthresh, making "
395399 "it effectively linear. You likely should lower the value "
396400 "of linthresh. " )
397401 with np .errstate (divide = "ignore" , invalid = "ignore" ):
398- out = np .sign (a ) * self .linthresh * (
402+ out = np .sign (values ) * self .linthresh * (
399403 np .power (self .base ,
400404 abs_a / self .linthresh - self ._linscale_adj ))
401405 inside = abs_a <= self .invlinthresh
402- out [inside ] = a [inside ] / self ._linscale_adj
406+ out [inside ] = values [inside ] / self ._linscale_adj
403407 return out
404408
405409 def inverted (self ):
@@ -473,8 +477,9 @@ def __init__(self, linear_width):
473477 "must be strictly positive" )
474478 self .linear_width = linear_width
475479
476- def transform_non_affine (self , a ):
477- return self .linear_width * np .arcsinh (a / self .linear_width )
480+ @_api .rename_parameter ("3.8" , "a" , "values" )
481+ def transform_non_affine (self , values ):
482+ return self .linear_width * np .arcsinh (values / self .linear_width )
478483
479484 def inverted (self ):
480485 return InvertedAsinhTransform (self .linear_width )
@@ -488,8 +493,9 @@ def __init__(self, linear_width):
488493 super ().__init__ ()
489494 self .linear_width = linear_width
490495
491- def transform_non_affine (self , a ):
492- return self .linear_width * np .sinh (a / self .linear_width )
496+ @_api .rename_parameter ("3.8" , "a" , "values" )
497+ def transform_non_affine (self , values ):
498+ return self .linear_width * np .sinh (values / self .linear_width )
493499
494500 def inverted (self ):
495501 return AsinhTransform (self .linear_width )
@@ -588,13 +594,14 @@ def __init__(self, nonpositive='mask'):
588594 self ._nonpositive = nonpositive
589595 self ._clip = {"clip" : True , "mask" : False }[nonpositive ]
590596
591- def transform_non_affine (self , a ):
597+ @_api .rename_parameter ("3.8" , "a" , "values" )
598+ def transform_non_affine (self , values ):
592599 """logit transform (base 10), masked or clipped"""
593600 with np .errstate (divide = "ignore" , invalid = "ignore" ):
594- out = np .log10 (a / (1 - a ))
601+ out = np .log10 (values / (1 - values ))
595602 if self ._clip : # See LogTransform for choice of clip value.
596- out [a <= 0 ] = - 1000
597- out [1 <= a ] = 1000
603+ out [values <= 0 ] = - 1000
604+ out [1 <= values ] = 1000
598605 return out
599606
600607 def inverted (self ):
@@ -611,9 +618,10 @@ def __init__(self, nonpositive='mask'):
611618 super ().__init__ ()
612619 self ._nonpositive = nonpositive
613620
614- def transform_non_affine (self , a ):
621+ @_api .rename_parameter ("3.8" , "a" , "values" )
622+ def transform_non_affine (self , values ):
615623 """logistic transform (base 10)"""
616- return 1.0 / (1 + 10 ** (- a ))
624+ return 1.0 / (1 + 10 ** (- values ))
617625
618626 def inverted (self ):
619627 return LogitTransform (self ._nonpositive )
0 commit comments