Skip to content

Change exception type for incorrect SVG date metadata #23206

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
Aug 15, 2022

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Jun 5, 2022

PR Summary

Better checking of metadata with better error messages. Tests for all metadata errors (changed ValueError to TypeError as should be more appropriate, release note required?).

Test for _escape_attrib.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus marked this pull request as ready for review June 5, 2022 16:25
@oscargus oscargus added this to the v3.6.0 milestone Jun 11, 2022
@oscargus oscargus force-pushed the svgtests branch 3 times, most recently from 0b0f279 to 3dafa4c Compare June 15, 2022 09:20
@oscargus oscargus changed the title Better error messages in SVG backend for Keywords metadata Better error messages for SVG metadata Jun 15, 2022
@oscargus
Copy link
Member Author

oscargus commented Jun 15, 2022

The linting failures are not correct as the code runs...

Edit: It seems like import pytest was removed in the week after I opened this PR...

Edit 2: And it was one of my other PRs that removed it...

@oscargus oscargus force-pushed the svgtests branch 2 times, most recently from a4df519 to 31455aa Compare June 15, 2022 09:42
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 seems to be a mix of .format and f-strings, and I don't see a reason why they should differ.

@oscargus
Copy link
Member Author

I guess that was a copy-and-paste thing, where I changed at some stage. Now it is refactored and uses some common check-and-error functions to avoid code duplication. (Didn't find it worthwhile to make it flexible enough to also deal with the different date formats.)

@oscargus oscargus force-pushed the svgtests branch 2 times, most recently from 54ca556 to 2766d49 Compare June 16, 2022 08:23
@oscargus oscargus force-pushed the svgtests branch 2 times, most recently from 0338b6f to d4e8a5f Compare June 21, 2022 16:13
@jklymak jklymak requested a review from QuLogic June 23, 2022 08:31
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.

Can you update the commit message to match the PR title?

@oscargus
Copy link
Member Author

Can you update the commit message to match the PR title?

Sure. Is the general rule that one should include that much info? I did it on purpose as saying SVG in a commit affecting backend_svg seems a bit bloated...

@QuLogic
Copy link
Member

QuLogic commented Jun 23, 2022

I dunno, "Better error messages" sounds too vague to me, while "Fix some typos" is vague enough to not need specifics...

@oscargus oscargus marked this pull request as draft July 7, 2022 07:19
@timhoffm timhoffm changed the title Better error messages for SVG metadata Changed exception type for incorrect SVG date metadata Aug 5, 2022
@oscargus oscargus changed the title Changed exception type for incorrect SVG date metadata Change exception type for incorrect SVG date metadata Aug 15, 2022
@oscargus oscargus marked this pull request as ready for review August 15, 2022 08:58
@tacaswell tacaswell merged commit d3038bf into matplotlib:main Aug 15, 2022
@oscargus oscargus deleted the svgtests branch August 15, 2022 15:21
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.

5 participants