@@ -93,7 +93,7 @@ class LogTransformBase(Transform):
9393 is_separable = True
9494 has_inverse = True
9595
96- def __init__ (self , nonpos ):
96+ def __init__ (self , nonpos = 'mask' ):
9797 Transform .__init__ (self )
9898 self ._clip = {"clip" : True , "mask" : False }[nonpos ]
9999
@@ -114,6 +114,8 @@ def transform_non_affine(self, a):
114114 out [a <= 0 ] = - 1000
115115 return out
116116
117+ def __str__ (self ):
118+ return "{}({!r})" .format (type (self ).__name__ , "clip" if self ._clip else "mask" )
117119
118120class InvertedLogTransformBase (Transform ):
119121 input_dims = 1
@@ -124,6 +126,9 @@ class InvertedLogTransformBase(Transform):
124126 def transform_non_affine (self , a ):
125127 return ma .power (self .base , a )
126128
129+ def __str__ (self ):
130+ return "{}()" .format (type (self ).__name__ )
131+
127132
128133class Log10Transform (LogTransformBase ):
129134 base = 10.0
@@ -168,7 +173,7 @@ def inverted(self):
168173
169174
170175class LogTransform (LogTransformBase ):
171- def __init__ (self , base , nonpos ):
176+ def __init__ (self , base , nonpos = 'mask' ):
172177 LogTransformBase .__init__ (self , nonpos )
173178 self .base = base
174179
@@ -448,7 +453,7 @@ class LogitTransform(Transform):
448453 is_separable = True
449454 has_inverse = True
450455
451- def __init__ (self , nonpos ):
456+ def __init__ (self , nonpos = 'mask' ):
452457 Transform .__init__ (self )
453458 self ._nonpos = nonpos
454459 self ._clip = {"clip" : True , "mask" : False }[nonpos ]
@@ -465,6 +470,9 @@ def transform_non_affine(self, a):
465470 def inverted (self ):
466471 return LogisticTransform (self ._nonpos )
467472
473+ def __str__ (self ):
474+ return "{}({!r})" .format (type (self ).__name__ , "clip" if self ._clip else "mask" )
475+
468476
469477class LogisticTransform (Transform ):
470478 input_dims = 1
@@ -483,6 +491,9 @@ def transform_non_affine(self, a):
483491 def inverted (self ):
484492 return LogitTransform (self ._nonpos )
485493
494+ def __str__ (self ):
495+ return "{}({!r})" .format (type (self ).__name__ , self ._nonpos )
496+
486497
487498class LogitScale (ScaleBase ):
488499 """
0 commit comments