-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: NumPy 1.24 deprecation warnings #24865
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
Comments
Thanks for the report! Unfortunately I can't reproduce this. What version of numpy are you using when the warning appears? |
Sorry, forgot to mention that you need to enable the warnings during normal execution, e.g., As for the NumPy version, I'm running $ python -c 'import numpy; print(numpy.__version__)'
1.24.0 |
Thanks, I can now reproduce 😄 |
The problem is that there are three more values, that are by default out of range in this case, to note specific cases: matplotlib/lib/matplotlib/colors.py Lines 673 to 675 in 8d2329a
(N = 256 by default) These are then assigned to out-of-range and masked/bad values here: matplotlib/lib/matplotlib/colors.py Lines 730 to 732 in 8d2329a
which now raises a deprecation warning. I think that one way forward would be to check the type of |
I think this is exposing a real bug that we need to promote the input data to be bigger than uint8. What we are doing here is buildin a lookup up table, the first N entries are for for values into the actually color map and then the next 3 entries are the special cases for over/under/bad so |
I don't know if this is a bigger bug or not, but I would like us to have fixed any deprecation warnings from dependencies before 3.7 is out (or if necessary a quick 3.7.1.) |
Change it to (np.array()).astype(np.int8) helps. |
Bug summary
Starting NumPy 1.24 I observe several deprecation warnings.
Code for reproduction
Actual outcome
Expected outcome
No warnings.
Additional information
No response
Operating system
ArchLinux
Matplotlib Version
3.6.2
Matplotlib Backend
QtAgg
Python version
Python 3.10.9
Jupyter version
No response
Installation
Linux package manager
The text was updated successfully, but these errors were encountered: