Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2024
Merged

Removal of deprecated API cm #26965

merged 1 commit into from
Feb 8, 2024

Conversation

UFEddy
Copy link
Contributor

@UFEddy UFEddy commented Sep 30, 2023

PR summary

PR addresses removal of deprecated API's referenced in issue #26865

Removals:

  • cm.register_cmap
  • cm.unregister_cmap
  • cm.get_cmap
  • pyplot.register_cmap

PR checklist

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several documentation build failures, as these functions were referenced in old What's New? entries. These should be changed to code style, as noted in the original issue.

_colormaps.register(cmap, name=name, force=override_builtin)
_colormaps._allow_override_builtin = False


def _get_cmap(name=None, lut=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should be moved from here to pyplot.py, as noted in their comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't see this one?

@QuLogic QuLogic added this to the v3.9.0 milestone Sep 30, 2023
@QuLogic QuLogic mentioned this pull request Sep 30, 2023
14 tasks
@QuLogic
Copy link
Member

QuLogic commented Sep 30, 2023

Also, tests are failing because you didn't remove any tests that were for the old code.

@UFEddy
Copy link
Contributor Author

UFEddy commented Oct 4, 2023

Thank you for reviewing the failures @QuLogic, I'll work on getting those updates in place.

@ksunden
Copy link
Member

ksunden commented Oct 11, 2023

Needs a rebase due to the build system change

- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you
have a `str`.

**Added 3.6.1** Use `matplotlib.cm.ColormapRegistry.get_cmap` if you
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to keep the Added 3.6.1 part.

_colormaps.register(cmap, name=name, force=override_builtin)
_colormaps._allow_override_builtin = False


def _get_cmap(name=None, lut=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't see this one?

@LiNk-NY
Copy link

LiNk-NY commented Oct 31, 2023

@UFEddy Are you still working on this?
I can do the rebase and add the minor changes to the review.
So far, I have https://github.com/LiNk-NY/matplotlib/tree/deprecate-cm
comparison : main...LiNk-NY:matplotlib:deprecate-cm

@QuLogic
Copy link
Member

QuLogic commented Dec 5, 2023

@LiNk-NY Since you've preserved the authorship there, I think maybe it should be alright to open a PR with your corrections.

@AkshitEP
Copy link

Hi, can i work on this issue for starting contributing in matplotlib

@QuLogic
Copy link
Member

QuLogic commented Feb 2, 2024

In the interest of getting 3.9 finished, I've rebased this, squashed everything, and removed the duplicate _get_cmap.

- deprecated cm api removal documentation
- Corrected formatting issues with documentation
- Removed corresponding type sub in related cm.pyi file and exceptions in mypy-stubtest
- Removed tests, updated documentation with code style for removed functions, moved code to pyplot from cm
- Revert "Removed tests, updated documentation with code style for removed functions, moved code to pyplot from cm"
  This reverts commit a8a4f7f.
- Documetation updates to match code style for deprecated api's
- Removed tests for deprecated api's
- Corrected documentation with full path and verbiage on removals
- Removed handling of override builtin from ColorMaRegistry
@github-actions github-actions bot added the Documentation: examples files in galleries/examples label Feb 2, 2024
@timhoffm timhoffm merged commit 5fc82d1 into matplotlib:main Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

6 participants