Skip to content

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

Description

@J-Christophe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions