Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd25d22

Browse files
authored
Merge pull request #31196 from scottshambaugh/rcparam_docs
DOC: Document which files need to be updated for new rcparams
2 parents 1017fe1 + 3eb9d14 commit cd25d22

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

doc/devel/api_changes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ take particular care when adding new API:
3232
__ https://emptysqua.re/blog/api-evolution-the-right-way/#adding-parameters
3333

3434

35+
Add new rcParams
36+
^^^^^^^^^^^^^^^^
37+
38+
When adding a new rcParam, the following files must be updated:
39+
40+
1. :file:`lib/matplotlib/rcsetup.py` - Add a validator entry to the
41+
``_validators`` dict and a corresponding ``_Param`` entry with default value
42+
and description.
43+
2. :file:`lib/matplotlib/mpl-data/matplotlibrc` - Add a commented-out entry
44+
showing the default value.
45+
3. :file:`lib/matplotlib/typing.py` - Add the key to the ``RcKeyType`` Literal
46+
so that it is recognized as a valid rcParam key.
47+
48+
3549
Add or change colormaps, color sequences, and styles
3650
----------------------------------------------------
3751
Visual changes are considered an API break. Therefore, we generally do not modify

doc/release/next_whats_new/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Instructions for writing "What's new" entries
1111
=============================================
1212
.. whats-new-guide-start
1313
14-
Each new feature (e.g. function, parameter, config value, behavior, ...) must
15-
be described through a "What's new" entry.
14+
Each new feature (e.g. function, parameter, rcParam, config value, behavior,
15+
...) must be described through a "What's new" entry.
1616

1717
Each entry is written into a separate file in the
1818
:file:`doc/release/next_whats_new/` directory. They are sorted and merged into

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
The default values of the rc settings are set in the default matplotlibrc file.
1111
Any additions or deletions to the parameter set listed here should also be
1212
propagated to the :file:`lib/matplotlib/mpl-data/matplotlibrc` in Matplotlib's
13-
root source directory.
13+
root source directory. New rcparams also need to be added to the RcKeyType enum
14+
in :file:`lib/matplotlib/typing.py`.
1415
"""
1516

1617

0 commit comments

Comments
 (0)