Title: Unit handling needs many more tests · Issue #18278 · matplotlib/matplotlib · GitHub
Open Graph Title: Unit handling needs many more tests · Issue #18278 · matplotlib/matplotlib
X Title: Unit handling needs many more tests · Issue #18278 · matplotlib/matplotlib
Description: Problem I've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. lib/matplotlib/tests/test_units.py only really checks plot, scatter, axhline, axvline, and bar, but we have many mor...
Open Graph Description: Problem I've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. lib/matplotlib/tests/test_units.py only really checks plot, scatter, axhline...
X Description: Problem I've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. lib/matplotlib/tests/test_units.py only really checks plot, scatter,...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18278
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unit handling needs many more tests","articleBody":"### Problem\r\n\r\nI've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. `lib/matplotlib/tests/test_units.py` only really checks `plot`, `scatter`, `axhline`, `axvline`, and `bar`, but we have many more artists that are peppered with unit conversion handling.\r\n\r\n### Proposed Solution\r\n\r\nWe need to expand `test_units.py` to cover almost all artist-creating functions that need to handle units. Now we have `check_figures_equal`, so we can do something about it that doesn't explore the number of test images, with a plot reference figure with non-unit functions, and a plot test figure with unitized functions.\r\n\r\nI don't really understand what the _expected_ unit conversion interface is, so I don't know how exactly to write the tests. I tried to do one for `errorbar` using `Quantity`, but it didn't work and I don't know if that's because `Quantity` does not implement enough for the unit registry, or whether `errorbar` doesn't correctly handle units.","author":{"url":"https://github.com/QuLogic","@type":"Person","name":"QuLogic"},"datePublished":"2020-08-18T04:44:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/18278/matplotlib/issues/18278"}
| 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:4459fb96-b399-35b2-d5b7-d80eddedd0b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B242:35F99B:2AC78:385C8:6A52D7E8 |
| html-safe-nonce | dffc44a9f4c4460ab61efe2afd6cb4471dee8feb9cd28f706421a48cdfa875b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjQyOjM1Rjk5QjoyQUM3ODozODVDODo2QTUyRDdFOCIsInZpc2l0b3JfaWQiOiI4NTY2NDIwNDI5NTIyMjYxOTkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ef66422c62ab2e842ca5810b628a90050ad53a020b67edbeb4cd8105354eafa7 |
| hovercard-subject-tag | issue:680685528 |
| 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/18278/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5dba11417df5a6279a6e9bd973024d0fb9a57b7cecc69429bd3a5671eaca50ba/matplotlib/matplotlib/issues/18278 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5dba11417df5a6279a6e9bd973024d0fb9a57b7cecc69429bd3a5671eaca50ba/matplotlib/matplotlib/issues/18278 |
| og:image:alt | Problem I've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. lib/matplotlib/tests/test_units.py only really checks plot, scatter, axhline... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | QuLogic |
| 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