Skip to content

Commit b4f6793

Browse files
committed
BUG: handle equal thresholds in threshold_firm
1 parent cc45b0d commit b4f6793

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎pywt/_thresholding.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ def threshold_firm(data, value_low, value_high):
239239
"value_high must be greater than or equal to value_low.")
240240

241241
data = np.asarray(data)
242+
243+
if value_low == value_high:
244+
return hard(data, value_low)
245+
242246
magnitude = np.absolute(data)
243247
with np.errstate(divide='ignore', invalid='ignore'):
244248
# divide by zero okay as np.inf values get clipped, so ignore warning.

0 commit comments

Comments
 (0)