8000 Edit error messages for when metadata is passed to `savefig` by ksunden · Pull Request #25430 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Edit error messages for when metadata is passed to savefig #25430

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 2 commits into from
Mar 14, 2023

Conversation

ksunden
Copy link
Member
@ksunden ksunden commented Mar 11, 2023

Closes #25401

As requested, the error message is more related to what users are
actually doing.

Slight behavior change, though not sure it's worth a release note in
that imsave will error if metadata is given for formats that don't
support it (this was done because it was unused if it was passed, and
if and when we add metadata support for those formats, it will be
implemented in imsave)

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

Closes matplotlib#25401

As requested, the error message is more related to what users are
actually doing.

Slight behavior change, though not sure it's worth a release note in
that `imsave` will error if metadata is given for formats that don't
support it (this was done because it was unused if it was passed, and
if and when we add metadata support for those formats, it will be
implemented in imsave)
@@ -441,7 +441,9 @@ def buffer_rgba(self):
"""
return self.renderer.buffer_rgba()

def print_raw(self, filename_or_obj):
def print_raw(self, filename_or_obj, metadata=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

should be kwonly.

@tacaswell tacaswell added this to the v3.8.0 milestone Mar 14, 2023
@oscargus oscargus merged commit 43c35e7 into matplotlib:main Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: savefig + jpg + metadata fails with inscrutable error message
4 participants
0