Open rmallof opened 1 year ago
Thanks for the report, you've reproduced an edge case with short inputs.
Until it's fixed, try one of: 1) higher nv
(e.g. 40); 2) scales='log'
; 3) longer data
.
Thank you for the response and the suggestions. It does work with longer data indeed. In this case, setting a higher nv parameter or the scales='log' still gives errors. Adding them here for convenience:
icwt(cwt, wavelet=wavelet, nv=40)
---> 80 icwt(cwt, wavelet=wavelet, nv=40)
File /opt/conda/envs/gst/lib/python3.8/site-packages/ssqueezepy/_cwt.py:380, in icwt(Wx, wavelet, scales, nv, one_int, x_len, x_mean, padtype, rpadded, l1norm)
377 # will override nv
to match scales
's
378 scales, scaletype, , nv = process_scales(scales, x_len, wavelet, nv=nv,
379 get_params=True)
--> 380 assert (len(scales) == na), "%s != %s" % (len(scales), na)
382 #### Handle piecewise scales case ########################################
383 # nv
must be left unspecified so it's inferred automatically from scales
384 # in process_scales
for each piecewise case
385 if scaletype == 'log-piecewise':
AssertionError: 276 != 222
icwt(cwt, wavelet=wavelet, scales='log') ---> 80 icwt(cwt, wavelet=wavelet, scales='log')
File /opt/conda/envs/gst/lib/python3.8/site-packages/ssqueezepy/_cwt.py:380, in icwt(Wx, wavelet, scales, nv, one_int, x_len, x_mean, padtype, rpadded, l1norm)
377 # will override nv
to match scales
's
378 scales, scaletype, , nv = process_scales(scales, x_len, wavelet, nv=nv,
379 get_params=True)
--> 380 assert (len(scales) == na), "%s != %s" % (len(scales), na)
382 #### Handle piecewise scales case ########################################
383 # nv
must be left unspecified so it's inferred automatically from scales
384 # in process_scales
for each piecewise case
385 if scaletype == 'log-piecewise':
AssertionError: 168 != 222
Please, let me know if I'm missing something. Again, great library :)
Right, I meant in cwt
(and therefore also in icwt
).
Description
Hi. Thanks for the library, is being really handy!
I found a way to crash the icwt function in the current version - 0.6.3
Provided are the time series and code required to reproduce the issue
data
Error message: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [2], in