WaveletPacketND.reconstruct() raises an IndexError for valid inputs when the reconstructed array needs to be trimmed to match the original input shape.
Minimal reproduction
import numpy as np
import pywt
x = np.arange(2 * 2 * 3, dtype=float).reshape(2, 2, 3)
wp = pywt.WaveletPacketND(
data=x,
wavelet="haar",
mode="symmetric",
axes=(0, 1, 2),
)
wp.get_level(1)
rec = wp.reconstruct(update=False)
This raises:
IndexError: only integers, slices (`:`), ellipsis (`...`),
numpy.newaxis (`None`) and integer or boolean arrays are valid indices
WaveletPacketND.reconstruct()raises anIndexErrorfor valid inputs when the reconstructed array needs to be trimmed to match the original input shape.Minimal reproduction
This raises: