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

Fix deprecation warning from np v1.20 #569

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucasb-eyer
Copy link

See also https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations for more info. This does not change semantics.

@lucasb-eyer
Copy link
Author

@tylin mind merging this? It can't possibly break anything, but the warnings are just annoying.

ppwwyyxx added a commit to ppwwyyxx/cocoapi that referenced this pull request Nov 4, 2022
@psyhtest
Copy link

Starting from NumPy 1.24.0, it's not a warning but an error. Similarly, for other data types:

$ python3
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.24.0'
>>> np.float
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anton/.local/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'
>>> np.object
<stdin>:1: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anton/.local/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'object'
>>> np.bool
<stdin>:1: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anton/.local/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool'

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.

2 participants