Title: [Bug]: NumPy 1.24 deprecation warnings · Issue #24865 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: NumPy 1.24 deprecation warnings · Issue #24865 · matplotlib/matplotlib
X Title: [Bug]: NumPy 1.24 deprecation warnings · Issue #24865 · matplotlib/matplotlib
Description: Bug summary Starting NumPy 1.24 I observe several deprecation warnings. Code for reproduction import matplotlib.pyplot as plt import numpy as np plt.get_cmap()(np.empty((0, ), dtype=np.uint8)) Actual outcome /usr/lib/python3.10/site-pack...
Open Graph Description: Bug summary Starting NumPy 1.24 I observe several deprecation warnings. Code for reproduction import matplotlib.pyplot as plt import numpy as np plt.get_cmap()(np.empty((0, ), dtype=np.uint8)) Actu...
X Description: Bug summary Starting NumPy 1.24 I observe several deprecation warnings. Code for reproduction import matplotlib.pyplot as plt import numpy as np plt.get_cmap()(np.empty((0, ), dtype=np.uint8)) Actu...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24865
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: NumPy 1.24 deprecation warnings","articleBody":"### Bug summary\r\n\r\nStarting NumPy 1.24 I observe several deprecation warnings.\r\n\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nplt.get_cmap()(np.empty((0, ), dtype=np.uint8))\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n```\r\n/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.\r\nFor the old behavior, usually:\r\n np.array(value).astype(dtype)`\r\nwill give the desired result (the cast overflows).\r\n xa[xa \u003e self.N - 1] = self._i_over\r\n/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.\r\nFor the old behavior, usually:\r\n np.array(value).astype(dtype)`\r\nwill give the desired result (the cast overflows).\r\n xa[xa \u003c 0] = self._i_under\r\n/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.\r\nFor the old behavior, usually:\r\n np.array(value).astype(dtype)`\r\nwill give the desired result (the cast overflows).\r\n xa[mask_bad] = self._i_bad\r\n```\r\n\r\n### Expected outcome\r\n\r\nNo warnings.\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### Operating system\r\n\r\nArchLinux\r\n\r\n### Matplotlib Version\r\n\r\n3.6.2\r\n\r\n### Matplotlib Backend\r\n\r\nQtAgg\r\n\r\n### Python version\r\n\r\nPython 3.10.9\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\nLinux package manager","author":{"url":"https://github.com/sergiud","@type":"Person","name":"sergiud"},"datePublished":"2023-01-01T21:25:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/24865/matplotlib/issues/24865"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6cc270dc-0f10-9c50-f7dc-f7fd38443d9f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9E4:2DCEA7:C301B3:101CC50:6A5321D2 |
| html-safe-nonce | 7209be676f90011c091bc3514a1df48f21a444f34cb8efba81ed4f4fdd66935f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUU0OjJEQ0VBNzpDMzAxQjM6MTAxQ0M1MDo2QTUzMjFEMiIsInZpc2l0b3JfaWQiOiIxNjQxODQ5Mjk2MTkzMjY2MTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f773dd5ec46a32e2280a0d62067d7e2a86471f68e3a281ce0d57692e26626f52 |
| hovercard-subject-tag | issue:1515844054 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/24865/issue_layout |
| twitter:image | https://opengraph.githubassets.com/274d6ff5e02bb19a84206c2dad492acb40512529ccaa95fa25033388f91c6e2d/matplotlib/matplotlib/issues/24865 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/274d6ff5e02bb19a84206c2dad492acb40512529ccaa95fa25033388f91c6e2d/matplotlib/matplotlib/issues/24865 |
| og:image:alt | Bug summary Starting NumPy 1.24 I observe several deprecation warnings. Code for reproduction import matplotlib.pyplot as plt import numpy as np plt.get_cmap()(np.empty((0, ), dtype=np.uint8)) Actu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sergiud |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width