Title: Fix format_cursor_data with nans. by anntzer · Pull Request #21145 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix format_cursor_data with nans. by anntzer · Pull Request #21145 · matplotlib/matplotlib
X Title: Fix format_cursor_data with nans. by anntzer · Pull Request #21145 · matplotlib/matplotlib
Description: Without this fix, hovering the mouse over a nan pixel in an imshow() would result in Warning: converting a masked element to nan. and then ValueError: cannot convert float NaN to integer. Fix that. The format_cursor_data test doesn't explicitly check the return value of get_cursor_data anymore because np.ma.masked is returned for nan inputs (this is expected from the general approach for handling invalid data); checking that format_cursor_data gives the right string is sufficient. Regression coming from #20949. PR Summary PR Checklist Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (run flake8 on changed files to check). New features are documented, with examples if plot related. Documentation is sphinx and numpydoc compliant (the docs should build without error). Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all). New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
Open Graph Description: Without this fix, hovering the mouse over a nan pixel in an imshow() would result in Warning: converting a masked element to nan. and then ValueError: cannot convert float NaN to integer. Fix that...
X Description: Without this fix, hovering the mouse over a nan pixel in an imshow() would result in Warning: converting a masked element to nan. and then ValueError: cannot convert float NaN to integer. Fix that...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/21145
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6ca5d870-b58d-509a-58e4-f65f2423ec56 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E290:4DD3F:1A7A24C:236819C:6A536193 |
| html-safe-nonce | f89899dfb40baab7a142d59edef2a186068328264174166dfa14b4b61ca98099 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjkwOjRERDNGOjFBN0EyNEM6MjM2ODE5Qzo2QTUzNjE5MyIsInZpc2l0b3JfaWQiOiI5MTc5MDA3ODgyNjI0MTk3MDExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c11b2b23804e66e4ed8189fffd72bbc825003b599753ff22d7f6cd28e0ceedc0 |
| hovercard-subject-tag | pull_request:739054115 |
| 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/21145/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | Without this fix, hovering the mouse over a nan pixel in an imshow() would result in Warning: converting a masked element to nan. and then ValueError: cannot convert float NaN to integer. Fix that... |
| 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