@@ -32,7 +32,7 @@ def soft(data, value, substitute=0):
3232
3333
3434def nn_garrote (data , value , substitute = 0 ):
35- """Non-negative Garotte ."""
35+ """Non-negative Garrote ."""
3636 data = np .asarray (data )
3737 magnitude = np .absolute (data )
3838
@@ -73,7 +73,10 @@ def less(data, value, substitute=0):
7373 'hard' : hard ,
7474 'greater' : greater ,
7575 'less' : less ,
76- 'garotte' : nn_garrote }
76+ 'garrote' : nn_garrote ,
77+ # misspelled garrote for backwards compatibility
78+ 'garotte' : nn_garrote ,
79+ }
7780
7881
7982def threshold (data , value , mode = 'soft' , substitute = 0 ):
@@ -90,7 +93,7 @@ def threshold(data, value, mode='soft', substitute=0):
9093 less than the value param are replaced with `substitute`. Data values with
9194 absolute value greater or equal to the thresholding value stay untouched.
9295
93- ``garotte `` corresponds to the Non-negative garrote threshold [2]_, [3]_.
96+ ``garrote `` corresponds to the Non-negative garrote threshold [2]_, [3]_.
9497 It is intermediate between ``hard`` and ``soft`` thresholding. It behaves
9598 like soft thresholding for small data values and approaches hard
9699 thresholding for large data values.
@@ -109,7 +112,7 @@ def threshold(data, value, mode='soft', substitute=0):
109112 Numeric data.
110113 value : scalar
111114 Thresholding value.
112- mode : {'soft', 'hard', 'greater', 'less'}
115+ mode : {'soft', 'hard', 'garrote', ' greater', 'less'}
113116 Decides the type of thresholding to be applied on input data. Default
114117 is 'soft'.
115118 substitute : float, optional
@@ -148,7 +151,7 @@ def threshold(data, value, mode='soft', substitute=0):
148151 array([ 0. , 0. , 0. , 0.5, 1. , 1.5, 2. ])
149152 >>> pywt.threshold(data, 2, 'hard')
150153 array([ 0. , 0. , 2. , 2.5, 3. , 3.5, 4. ])
151- >>> pywt.threshold(data, 2, 'garotte ')
154+ >>> pywt.threshold(data, 2, 'garrote ')
152155 array([ 0. , 0. , 0. , 0.9 , 1.66666667,
153156 2.35714286, 3. ])
154157 >>> pywt.threshold(data, 2, 'greater')
0 commit comments