Title: MNT: Fix handling of ints in rgb_to_hsv() by timhoffm · Pull Request #30815 · matplotlib/matplotlib · GitHub
Open Graph Title: MNT: Fix handling of ints in rgb_to_hsv() by timhoffm · Pull Request #30815 · matplotlib/matplotlib
X Title: MNT: Fix handling of ints in rgb_to_hsv() by timhoffm · Pull Request #30815 · matplotlib/matplotlib
Description: This is a numpy 2.0 regression. rgb_to_hsv((0, 1, 0)) used to work for numpy 1.x In [1]: from matplotlib.colors import rgb_to_hsv In [2]: rgb_to_hsv((0, 1, 0)) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[2], line 1 ----> 1 rgb_to_hsv((0, 1, 0)) File ~/git/matplotlib/lib/matplotlib/colors.py:3634, in rgb_to_hsv(arr) 3630 raise ValueError("Last dimension of input array must be 3; " 3631 f"shape {arr.shape} was found.") 3633 in_shape = arr.shape -> 3634 arr = np.array( 3635 arr, copy=False, 3636 dtype=np.promote_types(arr.dtype, np.float32), # Don't work on ints. 3637 ndmin=2, # In case input was 1D. 3638 ) 3640 out = np.zeros_like(arr) 3641 arr_max = arr.max(-1) ValueError: Unable to avoid copy while creating an array as requested. If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x). For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
Open Graph Description: This is a numpy 2.0 regression. rgb_to_hsv((0, 1, 0)) used to work for numpy 1.x In [1]: from matplotlib.colors import rgb_to_hsv In [2]: rgb_to_hsv((0, 1, 0)) ------------------------------------...
X Description: This is a numpy 2.0 regression. rgb_to_hsv((0, 1, 0)) used to work for numpy 1.x In [1]: from matplotlib.colors import rgb_to_hsv In [2]: rgb_to_hsv((0, 1, 0)) ------------------------------------...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/30815
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6d944eb9-a0b1-3962-2047-3419840c37ea |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C34A:1A5270:14FD5A:1B5597:6A52E642 |
| html-safe-nonce | 33ab1e376bdb80d1da5fb02ae89948dc847259964030d5b364b2524c7ffc5d13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzRBOjFBNTI3MDoxNEZENUE6MUI1NTk3OjZBNTJFNjQyIiwidmlzaXRvcl9pZCI6Ijc5MTE1NTcxNDk0NjkzNjk5MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5ca3019cc821febbaf4de81f27646a2a46dcc82ca1f4ed27afa70dd42953843b |
| hovercard-subject-tag | pull_request:3079028180 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/30815/files |
| twitter:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| og:image:alt | This is a numpy 2.0 regression. rgb_to_hsv((0, 1, 0)) used to work for numpy 1.x In [1]: from matplotlib.colors import rgb_to_hsv In [2]: rgb_to_hsv((0, 1, 0)) ------------------------------------... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| 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