@@ -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 = 'clip' ):
9797 Transform .__init__ (self )
9898 self ._clip = {"clip" : True , "mask" : False }[nonpos ]
9999
@@ -114,6 +114,10 @@ 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__ ,
119+ "clip" if self ._clip else "mask" )
120+
117121
118122class InvertedLogTransformBase (Transform ):
119123 input_dims = 1
@@ -124,6 +128,9 @@ class InvertedLogTransformBase(Transform):
124128 def transform_non_affine (self , a ):
125129 return ma .power (self .base , a )
126130
131+ def __str__ (self ):
132+ return "{}()" .format (type (self ).__name__ )
133+
127134
128135class Log10Transform (LogTransformBase ):
129136 base = 10.0
@@ -168,7 +175,7 @@ def inverted(self):
168175
169176
170177class LogTransform (LogTransformBase ):
171- def __init__ (self , base , nonpos ):
178+ def __init__ (self , base , nonpos = 'clip' ):
172179 LogTransformBase .__init__ (self , nonpos )
173180 self .base = base
174181
@@ -448,7 +455,7 @@ class LogitTransform(Transform):
448455 is_separable = True
449456 has_inverse = True
450457
451- def __init__ (self , nonpos ):
458+ def __init__ (self , nonpos = 'mask' ):
452459 Transform .__init__ (self )
453460 self ._nonpos = nonpos
454461 self ._clip = {"clip" : True , "mask" : False }[nonpos ]
@@ -465,6 +472,10 @@ def transform_non_affine(self, a):
465472 def inverted (self ):
466473 return LogisticTransform (self ._nonpos )
467474
475+ def __str__ (self ):
476+ return "{}({!r})" .format (type (self ).__name__ ,
477+ "clip" if self ._clip else "mask" )
478+
468479
469480class LogisticTransform (Transform ):
470481 input_dims = 1
@@ -483,6 +494,9 @@ def transform_non_affine(self, a):
483494 def inverted (self ):
484495 return LogitTransform (self ._nonpos )
485496
497+ def __str__ (self ):
498+ return "{}({!r})" .format (type (self ).__name__ , self ._nonpos )
499+
486500
487501class LogitScale (ScaleBase ):
488502 """
0 commit comments