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

initialized wk before adapt loop #56

Merged
merged 1 commit into from Jan 21, 2020
Merged

Conversation

yuvlyg
Copy link
Contributor

@yuvlyg yuvlyg commented Dec 6, 2018

pmtm with "adapt" method crashes if data is a constant vector
Loop is not entered (since convergence criterion is already met), so wk should be initialized before it.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0009%) to 97.505% when pulling 4ef0307 on yuvlyg:master into a02bf9d on cokelaer:master.

@cokelaer
Copy link
Owner

Sorry but I am probably missing something here. I tried with a constant vector as input but it seems to work:

from spectrum import mtm
m = mtm.pmtm([1,1,1,1,1,1,1,1])

and it does not crash. insteqd it returns valid vectors. Do you have an example of a crash that I can reproduce. thanks

@yuvlyg
Copy link
Contributor Author

yuvlyg commented Dec 20, 2018

My bad, it happens with zeros, not any constant vector:

from spectrum import mtm
import numpy as np
m = mtm.pmtm(np.zeros(100), NW=4)
# we get:
# UnboundLocalError: local variable 'wk' referenced before assignment

@cokelaer cokelaer merged commit fb09893 into cokelaer:master Jan 21, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants