Title: The great API cleanup · Issue #16181 · matplotlib/matplotlib · GitHub
Open Graph Title: The great API cleanup · Issue #16181 · matplotlib/matplotlib
X Title: The great API cleanup · Issue #16181 · matplotlib/matplotlib
Description: As discussed in the last call, technically public (i.e. not flagged as private with an underscore), but semantically internal API makes it hard to change anything in Matplotlib. I propose to set a focus on reducing the API footprint for ...
Open Graph Description: As discussed in the last call, technically public (i.e. not flagged as private with an underscore), but semantically internal API makes it hard to change anything in Matplotlib. I propose to set a ...
X Description: As discussed in the last call, technically public (i.e. not flagged as private with an underscore), but semantically internal API makes it hard to change anything in Matplotlib. I propose to set a ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16181
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The great API cleanup","articleBody":"As discussed in the last call, technically public (i.e. not flagged as private with an underscore), but semantically internal API makes it hard to change anything in Matplotlib.\r\n\r\nI propose to set a focus on reducing the API footprint for 3.3. With our current deprecation policy, we could remove that stuff from master once 3.4 is out, which should be towards the end of this year.\r\n\r\nIn particular:\r\n\r\n- Turn most parameters into keyword-only arguments. Depending on the function 0 to maybe 4 positional parameters should stay. Deprecations will be handled via `@cbook._make_keyword_only()`. This needs one of the approaches #14130 or #15254 to go in so that deprecations on Axes methods are also warned about in the pyplot wrappers.\r\n\r\n- Make more functions and methods private\r\n\r\n- Make more modules private. e.g. (not necessary complete):\r\n - [x] `afm`\r\n - [X] `blocking_input`\r\n - [x] `docstring`\r\n - [ ] `dviread`\r\n - [ ] \u003cs\u003e`font_manager`\u003c/s\u003e\r\n - [x] `fontconfig_pattern`\r\n - [ ] \u003cs\u003e`hatch`\u003c/s\u003e\r\n - [ ] \u003cs\u003e`legend_handler`\u003c/s\u003e\r\n - [x] `mathtext`\r\n - [ ] `texmanager`\r\n - [x] `tight_bbox`\r\n - [x] `tight_layout`\r\n - [x] `type1font`\r\n\r\n- Mechanism to deprecate whole modules:\r\n\r\n 1. Move the exising module `git mv my_module.py _my_module.py` and put this into a commit.\r\n 2. Create a new `my_module.py` with the content:\r\n ```\r\n from matplotlib._my_module import *\r\n from matplotlib import _api\r\n _api.warn_deprecated(\"3.3\", f\"The module {__name__} is deprecated\")\r\n ```\r\n and add this in a second commit.\r\n\r\n It is important to have the move in a separate commit to maintain the history of that code. If put together in one commit, git thinks we added `_my_module.py` and modified `my_module.py`. Then, we could not go back in history for the moved code.\r\n\r\n- [DONE] Move all the internal `cbook` functions to (a/multiple) private module(s).\r\n ```\r\n from matplotlib import _api\r\n\r\n @_api.deprecated(\"3.2\")\r\n def compare_versions(a, b):\r\n ```\r\n reads better than the current\r\n ```\r\n from matplotlib import cbook\r\n\r\n @cbook._deprecated(\"3.2\")\r\n def compare_versions(a, b):\r\n ```\r\n and it does not pollute the namespace with the public package name.\r\n\r\n- Rename `camelCase` to `camel_case` (when not too public; e.g. `rcParams` must stay).\r\n\r\n- Internally use `import mpl` and `mpl.rcParams` instead of `from matplotlib import rcParams` and `rcParams`. - Partially addressed in #16406.\r\n\r\n- remove the obscure function `pyplot.plotting()`, which is used as a container for the pyplot docstring.","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2020-01-11T00:35:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/16181/matplotlib/issues/16181"}
| 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:3e61e009-4710-9955-5d79-6ace8fccea94 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEA4:277A68:CF7443:1193585:6A5168D2 |
| html-safe-nonce | 8654d106f6e34f59a979a61e2f3e21bbfb9b83d6008c5fd8d9e09d094b5d7df5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUE0OjI3N0E2ODpDRjc0NDM6MTE5MzU4NTo2QTUxNjhEMiIsInZpc2l0b3JfaWQiOiI4NjY0NjUxNjE4Njg2NDI5Mzk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | be564d64a1f9f634fa8bc695b5d6ea9797f031861b9cf019fc5f3a02ac8cba0e |
| hovercard-subject-tag | issue:548352957 |
| 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/16181/issue_layout |
| twitter:image | https://opengraph.githubassets.com/010b136bf2f094daf05212490ed27f412e068837f6756c782a9ceb237c693767/matplotlib/matplotlib/issues/16181 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/010b136bf2f094daf05212490ed27f412e068837f6756c782a9ceb237c693767/matplotlib/matplotlib/issues/16181 |
| og:image:alt | As discussed in the last call, technically public (i.e. not flagged as private with an underscore), but semantically internal API makes it hard to change anything in Matplotlib. I propose to set a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| 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 | 60eaaf6d4dbaa817031b556aebd8a0a7eeb81b97 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width