Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect raising of ValueError("must set wavelet if scales isn't array") line 220 cwt_utils,py #67

Open
jelsom opened this issue May 13, 2022 · 1 comment

Comments

@jelsom
Copy link

jelsom commented May 13, 2022

Hi,

I've encountered what i believe to be a bug in a call to ssqueezepy.ssqueeze to synchro-squeeze a continous wavelet transform. I'll try to explain the issue as best i can, because i can't send the exact implementation. This is also my first issue, to bear with me if i get anything wrong in the format or conventions :)

I'm running ssqueezepy v0.6.3

The call is of the form:

Tx, fvec = sq.ssqueeze(
			Mx, w=phase, ssq_freqs="log", wavelet=wavelet, scales="log", fs=sampleRate, maprange="maximal",
			transform="cwt"
		)

where,

wavelet = sq.Wavelet("morlet") is set before calling the method. and is of type(wavelet) = ssqueezepy.wavelets.Wavelet

and Mx, phase are the normal matrices of the transform and phase produced by ssqueezepy.cwt()

In 'squeezing.py/squeeze' after the call to _process_args is completed, the following if statement on line 168 calls the method process_scales if transform == 'cwt'. See below

    if transform == 'cwt':
        scales, cwt_scaletype, _, nv = process_scales(scales, N, get_params=True)

However the call to process_scales does NOT pass the wavelet as an input argument (which it expects and sets to None if not passed). This results in the exception ValueError("must set `wavelet` if `scales` isn't array") being raised on line 220 in cwt_utils.pt/_process_args as called from process_scales.

The argument wavelet passed to ssqueeze() was in fact set correctly.

Hopefully that makes sense...

Thanks,
J.

@OverLordGoldDragon
Copy link
Owner

Thanks for the report. The debug details help, but please include a minimal reproducible example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants