Title: Fix wrong error message in #11919 by davidleejy · Pull Request #11930 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix wrong error message in #11919 by davidleejy · Pull Request #11930 · matplotlib/matplotlib
X Title: Fix wrong error message in #11919 by davidleejy · Pull Request #11930 · matplotlib/matplotlib
Description: PR Summary
Fixes issue #11919 .
This PR chains (appropriate) exceptions raised by mcolors.to_rgba_array() to additional exceptions raised by its caller scatter(). Now, the exception raised by mcolors.to_rgba_array() is visible if color values are outside of 0 to 1 range.
Prior to this PR, exceptions are not chained - see commit e3a8004. Exceptions raised by mcolors.to_rgba_array() were suppressed by exceptions of its caller scatter().
This PR applies exception chaining solely on scatter function. Author is open to helping chain other exceptions.
PEP 3134 advises on Exception Chaining. Example use: https://stackoverflow.com/questions/16414744/python-exception-chaining
Outcome
Case 1: color values outside 0 to 1 range
python -c "import numpy as np; import matplotlib.pyplot as plt; f =plt.figure(); ax = plt.axes(); ax.scatter(np.array([2]), np.array([3]), c=np.array([[12,130,140]]))"
Traceback (most recent call last):
File "
Open Graph Description: PR Summary Fixes issue #11919 . This PR chains (appropriate) exceptions raised by mcolors.to_rgba_array() to additional exceptions raised by its caller scatter(). Now, the exception raised by mcol...
X Description: PR Summary Fixes issue #11919 . This PR chains (appropriate) exceptions raised by mcolors.to_rgba_array() to additional exceptions raised by its caller scatter(). Now, the exception raised by mcol...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/11930
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0e87f01a-2dc2-2431-efa0-1536d8db97db |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 89A0:31D771:30563:41718:6A5674F9 |
| html-safe-nonce | 0d71a129386129c1c2d2afe2f5f327c818e9272ef423e441f26d3872864da49d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUEwOjMxRDc3MTozMDU2Mzo0MTcxODo2QTU2NzRGOSIsInZpc2l0b3JfaWQiOiIzNDk2MzA0MzM3OTUyODYzNDgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 31627a9ea6c0bb4091d8ba932da6f69c8142bafba941e2d5e83a9a90fb6e7f00 |
| hovercard-subject-tag | pull_request:210700155 |
| 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/11930/files |
| twitter:image | https://avatars.githubusercontent.com/u/1690072?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1690072?s=400&v=4 |
| og:image:alt | PR Summary Fixes issue #11919 . This PR chains (appropriate) exceptions raised by mcolors.to_rgba_array() to additional exceptions raised by its caller scatter(). Now, the exception raised by mcol... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width