Closed mandulaj closed 3 years ago
In reflect and antireflect mode, the edges are extended by reflecting the signal as per documentation:
reflect
antireflect
... x3 x2 | x1 x2 ... xn | xn-1 xn-2 ...
Problem is when the input is of length 1. There is no x2/xn-1 and effectively the code computing the extending elements enters an infinite loop.
1
x2
xn-1
import pywt cA, cD = pywt.dwt([1], 'db1', 'reflect') #<= Will hang in infinite loop
Raise a ValueError or IndexError to report unsupported length
ValueError
IndexError
Code enters infinite loop
In
reflect
andantireflect
mode, the edges are extended by reflecting the signal as per documentation:Problem is when the input is of length
1
. There is nox2
/xn-1
and effectively the code computing the extending elements enters an infinite loop.Steps to reproduce:
Expected result
Raise a
ValueError
orIndexError
to report unsupported lengthActual result
Code enters infinite loop