Skip to content

Numpy 2.0 deprecations #7

@ns-rse

Description

@ns-rse

Further to #5 and #6 np.complex_ deprecation needs correctly handling such as to maintain backwards compatibility as it throws up errors when run with newer versions of Numpy...

  File "/Users/sylvi/.pyenv/versions/3.11.9/envs/topostats/lib/python3.11/site-packages/numpyencoder/numpyencoder.py", line 31, in default
    elif isinstance(obj, (np.complex_, np.complex64, np.complex128)):
                          ^^^^^^^^^^^
  File "/Users/sylvi/.pyenv/versions/3.11.9/envs/topostats/lib/python3.11/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.complex_` was removed in the NumPy 2.0 release. Use `np.complex128` instead.

See here for more context.

Removing it completely as per #6 would, as noted, break backwards compatibility of numpyencoder.

I've never had to deal with such deprecations and maintaining backwards compatibility before but please let me know if there is anything I can do to help.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions