Elffuss BraidHub

kikocis/auto-code-rover public

main · 1.7 KiBRawPermalink
1[Bug]: NumPy 1.24 deprecation warnings
2### Bug summary
3
4Starting NumPy 1.24 I observe several deprecation warnings.
5
6
7### Code for reproduction
8
9```python
10import matplotlib.pyplot as plt
11import numpy as np
12
13plt.get_cmap()(np.empty((0, ), dtype=np.uint8))
14```
15
16
17### Actual outcome
18
19```
20/usr/lib/python3.10/site-packages/matplotlib/colors.py:730: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 257 to uint8 will fail in the future.
21For the old behavior, usually:
22 np.array(value).astype(dtype)`
23will give the desired result (the cast overflows).
24 xa[xa > self.N - 1] = self._i_over
25/usr/lib/python3.10/site-packages/matplotlib/colors.py:731: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 256 to uint8 will fail in the future.
26For the old behavior, usually:
27 np.array(value).astype(dtype)`
28will give the desired result (the cast overflows).
29 xa[xa < 0] = self._i_under
30/usr/lib/python3.10/site-packages/matplotlib/colors.py:732: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 258 to uint8 will fail in the future.
31For the old behavior, usually:
32 np.array(value).astype(dtype)`
33will give the desired result (the cast overflows).
34 xa[mask_bad] = self._i_bad
35```
36
37### Expected outcome
38
39No warnings.
40
41### Additional information
42
43_No response_
44
45### Operating system
46
47ArchLinux
48
49### Matplotlib Version
50
513.6.2
52
53### Matplotlib Backend
54
55QtAgg
56
57### Python version
58
59Python 3.10.9
60
61### Jupyter version
62
63_No response_
64
65### Installation
66
67Linux package manager