Describe the issue:
Starting in v1.20, when calling a numpy built in type prints a warning:
FutureWarning: In the future 'np.bool' will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.
It seems these types were dropped in v1.24, resulting in the exception:
AttributeError: module 'numpy' has no attribute 'bool'. Did you mean: 'bool_'?
However, the warning is still shown. It seems redundant or incorrect in its current form.
Only the exception should be shown, or the warning text should be changed.
Reproduce the code example:
import numpy as np
np.bool
Error message:
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 "C:\Users\user\miniconda3\envs\envName\Lib\site-packages\numpy\__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool'. Did you mean: 'bool_'?
Runtime information:
Not relevant
Context for the issue:
It's simply a confusing combination of contradicting warning and exception.
Judging by the warning type and text, it seems that the exception should not be raised (FutureWarning type and "in the future" text)
Describe the issue:
Starting in v1.20, when calling a numpy built in type prints a warning:
FutureWarning: In the future 'np.bool' will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.It seems these types were dropped in v1.24, resulting in the exception:
AttributeError: module 'numpy' has no attribute 'bool'. Did you mean: 'bool_'?However, the warning is still shown. It seems redundant or incorrect in its current form.
Only the exception should be shown, or the warning text should be changed.
Reproduce the code example:
Error message:
Runtime information:
Not relevant
Context for the issue:
It's simply a confusing combination of contradicting warning and exception.
Judging by the warning type and text, it seems that the exception should not be raised (FutureWarning type and "in the future" text)