Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Removal of deprecated API cm#26965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 0 additions & 4 deletionsci/mypy-stubtest-allowlist.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletionsdoc/api/next_api_changes/removals/26965-ER.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| Removal of top-level cmap registration and access functions in ``mpl.cm`` | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| As part of the `multi-step refactoring of colormap registration | ||
| <https://github.com/matplotlib/matplotlib/issues/20853>`_, the following functions have | ||
| been removed: | ||
| - ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you | ||
| have a `str`. | ||
| Use `matplotlib.cm.ColormapRegistry.get_cmap` if you have a `str`, `None` or a | ||
| `matplotlib.colors.Colormap` object that you want to convert to a `.Colormap` | ||
| object. | ||
| - ``matplotlib.cm.register_cmap``; use `matplotlib.colormaps.register | ||
| <.ColormapRegistry.register>` instead. | ||
| - ``matplotlib.cm.unregister_cmap``; use `matplotlib.colormaps.unregister | ||
| <.ColormapRegistry.unregister>` instead. | ||
| - ``matplotlib.pyplot.register_cmap``; use `matplotlib.colormaps.register | ||
| <.ColormapRegistry.register>` instead. | ||
| The `matplotlib.pyplot.get_cmap` function will stay available for backward | ||
| compatibility. |
2 changes: 1 addition & 1 deletiondoc/api/prev_api_changes/api_changes_0.99.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletionsdoc/api/prev_api_changes/api_changes_3.2.0/behavior.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiondoc/api/prev_api_changes/api_changes_3.3.0/deprecations.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiondoc/api/prev_api_changes/api_changes_3.4.0/behaviour.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletionsdoc/api/prev_api_changes/api_changes_3.6.0/behaviour.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletionsdoc/api/prev_api_changes/api_changes_3.7.0/behaviour.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiondoc/users/prev_whats_new/whats_new_1.2.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiondoc/users/prev_whats_new/whats_new_3.4.0.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletionsdoc/users/prev_whats_new/whats_new_3.5.0.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiongalleries/examples/color/custom_cmap.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionlib/matplotlib/_cm.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
131 changes: 2 additions & 129 deletionslib/matplotlib/cm.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -83,8 +83,6 @@ class ColormapRegistry(Mapping): | ||
| def __init__(self, cmaps): | ||
| self._cmaps = cmaps | ||
| self._builtin_cmaps = tuple(cmaps) | ||
| def __getitem__(self, item): | ||
| try: | ||
| @@ -146,10 +144,8 @@ def register(self, cmap, *, name=None, force=False): | ||
| # unless explicitly asked to | ||
| raise ValueError( | ||
| f'A colormap named "{name}" is already registered.') | ||
| elif name in self._builtin_cmaps: | ||
| # We don't allow overriding a builtin. | ||
| raise ValueError("Re-registering the builtin cmap " | ||
| f"{name!r} is not allowed.") | ||
| @@ -236,129 +232,6 @@ def get_cmap(self, cmap): | ||
| globals().update(_colormaps) | ||
QuLogic marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| def _auto_norm_from_scale(scale_cls): | ||
| """ | ||
| Automatically generate a norm class from *scale_cls*. | ||
2 changes: 0 additions & 2 deletionslib/matplotlib/cm.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
42 changes: 29 additions & 13 deletionslib/matplotlib/pyplot.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.