In the denoising for-loop (starting line 157) there is a possibility that on line 184 the variable t is empty. In terms of the noise and signal this is handles by an isempty if-statement (lines 186-198) but for the npars parameter it's not, which makes it crash if t is empty. I suggest adding that to the isempty if-statement to resolve it. (Or, neither npars nor Npars is actually returned just remove it)
In the denoising for-loop (starting line 157) there is a possibility that on line 184 the variable t is empty. In terms of the noise and signal this is handles by an isempty if-statement (lines 186-198) but for the npars parameter it's not, which makes it crash if t is empty. I suggest adding that to the isempty if-statement to resolve it. (Or, neither npars nor Npars is actually returned just remove it)