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

TypeError with EMD_matlab #165

Closed
LeonardoLancia opened this issue Sep 11, 2024 · 4 comments
Closed

TypeError with EMD_matlab #165

LeonardoLancia opened this issue Sep 11, 2024 · 4 comments
Assignees

Comments

@LeonardoLancia
Copy link

Describe the bug
the fix for using numpy>=2 introduces a Type Error when using EMD_matlab:

TypeError: unhashable type: 'list'

To Reproduce
from PyEMD import EMD_matlab as EMDm
import numpy as np
x=np.sin(np.linspace(0,24,200))
emdObj = EMDm.EMD()
IMFs=emdObj.emd(x)

Expected behavior
no error is expected here

Running environment
Windows 10, PyEMD version 1.6.2

@laszukdawid
Copy link
Owner

Thanks for letting me know. It should be fixed now in 1.6.3. Please give it a go, and please let me know if it's actually fixed.

@LeonardoLancia
Copy link
Author

I tried it and could make it work with two furhter (small) changes:

  1. comment line 431:
    @staticmethod

  2. change line 460 from:

S, T = unify_type(S, T)

to

S, T = unify_types(S, T)

Thank you!

@laszukdawid
Copy link
Owner

Thanks for testing. EMD_matlab was never really the focus so it was created, tested and left. My bad, there should've been at least regression tests to make sure things aren't broken. Will add these shortly. The typo is embarrassing ^_^

As for commenting @staticmethod... 10 years ago there must have been some reason for it but looking at it now, I don't know why it's there, especially that self is passed as the first argument. I cannot "fix" this now because this might break some people's workflows. However, this should be "resolved" in major version upgrade.

@laszukdawid
Copy link
Owner

Fix added in 1.6.4 (#166 )

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