Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add machinery for png-only, single-font mathtext tests.#19261

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
QuLogic merged 3 commits intomatplotlib:masterfromanntzer:mathtextlightweighttests
Jan 16, 2021

Conversation

anntzer
Copy link
Contributor

Alternate for#19201. png turns out to be heavier than svg-without-font embedding, but if we stick to a single font it's cheaper that testing all 5 fonts in svg. (For the sqrt test added below, each font adds ~2k to the size of the baseline image file.)

PR Summary

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

horizontalalignment='center', verticalalignment='center')


font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests)))
Copy link
Member

Choose a reason for hiding this comment

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

I think this filtering should stay right below the definition offont_tests, because it's only a helper to sanetize the list (namely, to skip deleted tests).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I added another commit (actually, a first commit) to factor out test skipping for all ofmathtext_rendering,mathtext_rendering_lightweight, andmathfont_rendering.

Just pytest.skip()ping them in the baseline_images fixture will avoidhaving to duplicate the logic in the upcoming png-only tests.
(For the sqrt test added below, each font adds ~2k to the size of thebaseline image file.)
@anntzeranntzerforce-pushed themathtextlightweighttests branch from86f97b2 to7f7fad9CompareJanuary 9, 2021 12:54
@@ -114,6 +114,7 @@
# default) and only png outputs, in order to minimize the size of baseline
# images.
lightweight_math_tests = [
r'$\sqrt[ab]{123}$', # github issue #8665
Copy link
Member

Choose a reason for hiding this comment

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

What's up with theab alignment? It doesn't appear to follow the baseline to me, but align to top instead.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This only appears with text.hinting = "none" (which is used by tests, but is not the default otherwise). I suspect this is just one of the vertical alignments problems mentioned in#5414.
Also manually testing with a large text size (e.g. 48) allows verifying that there is no top-alignment.

@QuLogicQuLogic reopened thisJan 16, 2021
@QuLogicQuLogic merged commit07d4530 intomatplotlib:masterJan 16, 2021
@QuLogicQuLogic added this to thev3.4.0 milestoneJan 16, 2021
@anntzeranntzer deleted the mathtextlightweighttests branchJanuary 16, 2021 20:51
@ednl
Copy link

Thanks for doing this. Can't wait for it to be released, mainly for "noninteger bases in mathtext sqrt" which I ran in to recently.

@anntzeranntzer mentioned this pull requestFeb 7, 2021
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

4 participants
@anntzer@ednl@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp