Title: Define the supported rcParams as code by timhoffm · Pull Request #30871 · matplotlib/matplotlib · GitHub
Open Graph Title: Define the supported rcParams as code by timhoffm · Pull Request #30871 · matplotlib/matplotlib
X Title: Define the supported rcParams as code by timhoffm · Pull Request #30871 · matplotlib/matplotlib
Description: Current status Until now, the parameter definition was dispersed: valid names and defaults are loaded from the canonical matplotlibrc data file. Docs are only available as comments in there. Validators are attached ad-hoc in rcsetup.py. Proposed change Define the parameters in code, including meta-information, like validators, docs in a single place. It will simplify the rcParams related code in matplotlib.__init__.py and matplotlib.rcsetup.py. It also enables us to generate sphinx documentation on the parameters. Closes #23531. Superseeds #26088. Ensuring consistency through tests is a better approach than trying to be able to exactly reproduce matplotlibrc. Discarded alternative: Use another stuctured data file to store the information. Among available formats, I would only find YAML easy enough to human-read and -write this kind of structured information. But I don't want to introduce a YAML parser as a dependency. Notes: This is a PoC and nothing is set in stone. In particular no special care has been taken of The exact structures how we want to define the parameters (is a dataclass good? Likely yes, but ymmv) and format them so that they are as readable as possible. Description of the parameters. These are just extracted from matplotlibrc More fancy stuff like grouping, additional info like human-readable accepted values may come later. Representation in the docs. Generating and embedding a simple rst page will not be the final state. My plan is to make a proper sphinx extension so that :rc:some.param can directly line the parameters. Location of the params documentation in the docs. Transition plan: matplotlibrc and the validator lists are used for functionality. Tests ensure that the new definitions match the existing ones. After we have merged, a later PR will switch to using the content from the new definitions and remove matplotlibrc and the validator lists. How to review: ignore the failing stubtests you don't have to check that all parameters are there or have correct defaults or config values. That is covered by the tests look at the parameter definitions to see whether that is a suitable format. Is it good to read and write? look at the rendered docs to get a first impression on how a list of parameters could look like. How can we improve on that? https://output.circle-artifacts.com/output/job/18c5a4fc-ca4b-4e81-b608-3b175644c660/artifacts/0/doc/build/html/users/explain/customizing.html#description-of-rcparams Feedback welcome.
Open Graph Description: Current status Until now, the parameter definition was dispersed: valid names and defaults are loaded from the canonical matplotlibrc data file. Docs are only available as comments in there. Valida...
X Description: Current status Until now, the parameter definition was dispersed: valid names and defaults are loaded from the canonical matplotlibrc data file. Docs are only available as comments in there. Valida...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/30871
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ddb587f3-9a4b-4b11-d3d1-b651fe578277 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D77E:1ECC24:140A5B0:1ABA688:6A52AD02 |
| html-safe-nonce | b626fd93bec0a64176a72fc3c51ce5429d67b50e07e5010d2b8582c3370f0390 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzdFOjFFQ0MyNDoxNDBBNUIwOjFBQkE2ODg6NkE1MkFEMDIiLCJ2aXNpdG9yX2lkIjoiODkyMDc2MTAwMzg3ODI5NjgzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c969dd8b3c03d6ec6c3253c76bf62e7b36af5bf389d9404abe21eed80ed78b53 |
| hovercard-subject-tag | pull_request:3107760298 |
| 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/30871/files |
| twitter:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2836374?s=400&v=4 |
| og:image:alt | Current status Until now, the parameter definition was dispersed: valid names and defaults are loaded from the canonical matplotlibrc data file. Docs are only available as comments in there. Valida... |
| 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