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

Compatibility Issue with NumPy 2.x: np.ComplexWarning Not Defined #54

Open
J-Christophe opened this issue Aug 28, 2024 · 1 comment
Open

Comments

@J-Christophe
Copy link

Hello,

I am experiencing an issue with the deepdish library when using it with NumPy 2.1.0. Specifically, I cannot import deepdish due to the following error:

AttributeError: module 'numpy' has no attribute 'ComplexWarning'

The problem is located in the code at the following line https://github.com/uchicago-cs/deepdish/blob/3f2dff7a03f1b31f6924b665ad5b8c299329c1cd/deepdish/core.py#L8C1-L8C51

warnings.simplefilter("ignore", np.ComplexWarning)

Could you please address this issue by either:

  1. Removing the reference to np.ComplexWarning from your code.
  2. Adding a compatibility check, such as: if hasattr(np, 'ComplexWarning'): warnings.simplefilter("ignore", np.ComplexWarning)

This change will help ensure compatibility with newer versions of NumPy.

Best regards,
Jean-Christophe

@J-Christophe
Copy link
Author

Another compatibility issue with numpy 2 using the example of the tutorial:

import deepdish as dd
d = {'foo': np.arange(10), 'bar': np.ones((5, 4, 3))}
dd.io.save('test.h5', d)

AttributeError: np.unicode_ was removed in the NumPy 2.0 release. Use np.str_ instead

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

1 participant