@@ -1415,13 +1415,14 @@ def __call__(self, value, clip=None):
1415
1415
return super ().__call__ (value , clip = clip )
1416
1416
1417
1417
1418
- def _make_norm_from_scale (scale_cls , base_norm_cls = None , * , init = None ):
1418
+ def make_norm_from_scale (scale_cls , base_norm_cls = None , * , init = None ):
1419
1419
"""
1420
- Decorator for building a `.Normalize` subclass from a `.Scale` subclass.
1420
+ Decorator for building a `.Normalize` subclass from a `~.scale.ScaleBase`
1421
+ subclass.
1421
1422
1422
1423
After ::
1423
1424
1424
- @_make_norm_from_scale (scale_cls)
1425
+ @make_norm_from_scale (scale_cls)
1425
1426
class norm_cls(Normalize):
1426
1427
...
1427
1428
@@ -1436,7 +1437,7 @@ class norm_cls(Normalize):
1436
1437
a dummy axis).
1437
1438
1438
1439
If the *scale_cls* constructor takes additional parameters, then *init*
1439
- should be passed to `_make_norm_from_scale `. It is a callable which is
1440
+ should be passed to `make_norm_from_scale `. It is a callable which is
1440
1441
*only* used for its signature. First, this signature will become the
1441
1442
signature of *norm_cls*. Second, the *norm_cls* constructor will bind the
1442
1443
parameters passed to it using this signature, extract the bound *vmin*,
@@ -1446,7 +1447,7 @@ class norm_cls(Normalize):
1446
1447
"""
1447
1448
1448
1449
if base_norm_cls is None :
1449
- return functools .partial (_make_norm_from_scale , scale_cls , init = init )
1450
+ return functools .partial (make_norm_from_scale , scale_cls , init = init )
1450
1451
1451
1452
if init is None :
1452
1453
def init (vmin = None , vmax = None , clip = False ): pass
@@ -1509,7 +1510,7 @@ def inverse(self, value):
1509
1510
return Norm
1510
1511
1511
1512
1512
- @_make_norm_from_scale (
1513
+ @make_norm_from_scale (
1513
1514
scale .FuncScale ,
1514
1515
init = lambda functions , vmin = None , vmax = None , clip = False : None )
1515
1516
class FuncNorm (Normalize ):
@@ -1542,7 +1543,7 @@ def forward(values: array-like) -> array-like
1542
1543
"""
1543
1544
1544
1545
1545
- @_make_norm_from_scale (functools .partial (scale .LogScale , nonpositive = "mask" ))
1546
+ @make_norm_from_scale (functools .partial (scale .LogScale , nonpositive = "mask" ))
1546
1547
class LogNorm (Normalize ):
1547
1548
"""Normalize a given value to the 0-1 range on a log scale."""
1548
1549
@@ -1555,7 +1556,7 @@ def autoscale_None(self, A):
1555
1556
super ().autoscale_None (np .ma .array (A , mask = (A <= 0 )))
1556
1557
1557
1558
1558
- @_make_norm_from_scale (
1559
+ @make_norm_from_scale (
1559
1560
scale .SymmetricalLogScale ,
1560
1561
init = lambda linthresh , linscale = 1. , vmin = None , vmax = None , clip = False , * ,
1561
1562
base = 10 : None )
0 commit comments