Title: [MNT]: User feedback should use warnings, not logs · Issue #23422 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: User feedback should use warnings, not logs · Issue #23422 · matplotlib/matplotlib
X Title: [MNT]: User feedback should use warnings, not logs · Issue #23422 · matplotlib/matplotlib
Description: Summary There are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning. Two examples I've encountered recently: Passi...
Open Graph Description: Summary There are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning. Two e...
X Description: Summary There are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning. Two e...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23422
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: User feedback should use warnings, not logs","articleBody":"### Summary\r\n\r\nThere are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning.\r\n\r\nTwo examples I've encountered recently:\r\n\r\n- [Passing string-formatted numbers as data](https://github.com/matplotlib/matplotlib/blob/v3.5.2/lib/matplotlib/category.py#L234-L237)\r\n- [Done] \u003cs\u003e[Passing an RGB tuple to the `c` parameter of `scatter`](https://github.com/matplotlib/matplotlib/blob/v3.5.2/lib/matplotlib/axes/_axes.py#L4203-L4210)\u003c/s\u003e\r\n\r\nI don't think logging is the right mechanism here:\r\n\r\n- The feedback provides very little information about the source of the problem, you just get some text in stderr.\r\n- Related, you can convert a warning to an error and then drop into a debugger to figure out what's happening; I don't think that's the case with logging?\r\n- Warnings can be intercepted by third party libraries that are doing something on purpose (i.e., passing numbers-as-strings to use a categorical axis), whereas logs are harder to muffle without intervening.\r\n\r\n### Proposed fix\r\n\r\nIt's possible I am wrong here, but `warnings.warn` feels like the right mechanism for both of these pieces of feedback.","author":{"url":"https://github.com/mwaskom","@type":"Person","name":"mwaskom"},"datePublished":"2022-07-12T22:41:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":42},"url":"https://github.com/23422/matplotlib/issues/23422"}
| 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:ddde0721-f21c-8a7b-f450-bc39ccec433c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8648:1F2FB0:1912E1:211E8A:6A525532 |
| html-safe-nonce | b3df93967e2b29d53fe80bf90d3c83b48cc58d453f142446154ba1a51efb4d50 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjQ4OjFGMkZCMDoxOTEyRTE6MjExRThBOjZBNTI1NTMyIiwidmlzaXRvcl9pZCI6IjYxOTExOTY0MDU4MTM5NTc2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2c47792ebe811090cb604ed9ac1e1b77c0ae352961af437211d7e4b9cb668282 |
| hovercard-subject-tag | issue:1302689739 |
| 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/23422/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00e68b78d45b5d67cc9ab5e641e3def350a1301a28174278beea52eeb7222fd5/matplotlib/matplotlib/issues/23422 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00e68b78d45b5d67cc9ab5e641e3def350a1301a28174278beea52eeb7222fd5/matplotlib/matplotlib/issues/23422 |
| og:image:alt | Summary There are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning. Two e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mwaskom |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width