Skip to content
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

Deprecate tostring_rgb. #25484

Merged
merged 1 commit into from Mar 17, 2023
Merged

Deprecate tostring_rgb. #25484

merged 1 commit into from Mar 17, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Mar 17, 2023

As noted previously (#5336, see in particular the comments in the thread), silently dropping alpha can be confusing. Also, directly accessing the buffer array is more efficient (it does not involve copying to a string buffer) and should cover most use cases.

Closes #5336.

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

As noted previously, silently dropping alpha can be confusing.  Also,
directly accessing the buffer array is more efficient (it does not
involve copying to a string buffer) and should cover most use cases.
@anntzer anntzer added this to the v3.8.0 milestone Mar 17, 2023
@@ -414,6 +415,7 @@ def get_renderer(self, cleared=False):
self.renderer.clear()
return self.renderer

@_api.deprecated("3.8")
Copy link
Member

Choose a reason for hiding this comment

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

Do we need any of these tostring_ methods? and even if we do, should they not be private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also deprecate tostring_argb (which we don't use either anymore); I don't have a strong opinion here.

@ksunden ksunden merged commit b1f8b66 into matplotlib:main Mar 17, 2023
32 checks passed
@anntzer anntzer deleted the tad branch March 17, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RendererAgg.tostring_rgb merely truncates alpha
4 participants