GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TST: Remove unnecessary test images by QuLogic · Pull Request #29827 · matplotlib/matplotlib

Conversation

@QuLogic

@QuLogic QuLogic commented Mar 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR summary

There's no need to test multiple file formats for tests that:

  • are for wrappers that simplify or combine other primitives, such as boxplot, eventplot, axhspan, or fill_between.
  • are for spine or tick settings, such as the autoscale_tiny_range, formatter_ticker_*.
  • are for alternate Axes projections, such as polar, Mollweide, or skewed Axes.

This is certainly not exhaustive; I did not remove any of the mathtext formats (seemed like a good glyph test), anything with hatching/clipping/alpha (probably could be pared down to just a few), markevery tests (don't recall if that required anything in the backend), or tight layout tests.

PR checklist

  • [n/a] "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New Features and API Changes are noted with a directive and release note
  • [n/a] Documentation complies with general and docstring guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rcomer reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@QuLogic QuLogic mentioned this pull request Mar 29, 2025
Update FreeType to 2.13.3 #29816
Merged
5 tasks
@QuLogic

QuLogic commented Mar 29, 2025

Copy link
Copy Markdown
Member Author

If code coverage passes, that should be at least some indicator that we didn't drop anything relevant.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jklymak jklymak mentioned this pull request Mar 31, 2025
TST: remove (most) text from constrained layout tests #29833
Closed
@QuLogic
QuLogic force-pushed the test-reduction branch from a706046 to 0421321 Compare March 31, 2025 23:46
@QuLogic

QuLogic commented Mar 31, 2025

Copy link
Copy Markdown
Member Author

OK, I've also removed hist2d (because it is just a pcolormesh), and markevery (because it's just a line + scatter).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell

tacaswell commented Apr 1, 2025

Copy link
Copy Markdown
Member

Why prefer png over svg/pdf?

A spot check of sizes looks like the pdf's are the smallest (presumably because they are compressed by default) and svgs are the most "text like" so should play the best with git. I was going to assert that the vector layouts would be insensative to freetype but began to doubt that as I was typing (I am not sure if we rely on freetype to do any placement even in those cases).

The biggest upside I see of png is that it is no optional test-deps to run.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell tacaswell added this to the v3.11.0 milestone Apr 1, 2025
@QuLogic

QuLogic commented Apr 1, 2025

Copy link
Copy Markdown
Member Author

A spot check of sizes looks like the pdf's are the smallest (presumably because they are compressed by default) and svgs are the most "text like" so should play the best with git. I was going to assert that the vector layouts would be insensative to freetype but began to doubt that as I was typing (I am not sure if we rely on freetype to do any placement even in those cases).

Unfortunately not, or this wouldn't have come up in #29816. Admittedly, I don't think it's all of them, though.

The biggest upside I see of png is that it is no optional test-deps to run.

This is definitely the main reason, but I have no issues with changing to SVG/PDF if we think that's okay.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell

tacaswell commented Apr 1, 2025

Copy link
Copy Markdown
Member

I also suspect (but have not measured) that the png tests are faster as we don't effectively render 2x and require a sub-process to be running.

Despite asking the question, I'm coming around to png being the right choice.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timhoffm

timhoffm commented Apr 2, 2025

Copy link
Copy Markdown
Member

Should we change the default extensions of check_figures_equal to only png? Figure comparisons often create the same artists but with different code paths. Therefore rendering to any output should be sufficient. I believe it's quite the exception that we need more than one output.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@QuLogic

QuLogic commented Apr 2, 2025

Copy link
Copy Markdown
Member Author

Good idea, but it is in the public API right now. I seem to recall us saying that matplotlib.testing may not have the same API guarantees, but I can't find where that is.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timhoffm

timhoffm commented Apr 3, 2025

Copy link
Copy Markdown
Member

I'd be so bold and just change it, documenting it in an API change note.

It should be "what users want" 99% of the time, and there's no simple deprecation/migration route.

tacaswell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@QuLogic
QuLogic force-pushed the test-reduction branch from 0421321 to acbea94 Compare April 3, 2025 03:30
@github-actions github-actions Bot added topic: mplot3d Documentation: devdocs files in doc/devel labels Apr 3, 2025
@QuLogic

QuLogic commented Apr 3, 2025

Copy link
Copy Markdown
Member Author

OK, I've changed the default and removed the extraneous extensions arguments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm reviewed Apr 3, 2025
View reviewed changes
Comment thread lib/matplotlib/tests/test_patches.py
assert np.all(result == expected)


# Currently fails with pdf/svg, probably because some parts assume a dpi of 72.

@timhoffm timhoffm Apr 3, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Should we leave this comment?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@QuLogic QuLogic Apr 3, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It looks like it does still fail on PDF/SVG, so we can leave it in.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
timhoffm
timhoffm reviewed Apr 3, 2025
View reviewed changes
Comment thread lib/matplotlib/testing/decorators.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@timhoffm

timhoffm commented Apr 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Not a 100% exact comparison but this test run is 9630 tests in 12:37min, where a test run on another recent PR is 9845 tests in 13:54min. So a rough estimate is that we have shaved off 200 tests and 1:20min test runtime. That's a significant improvement 🎉.

rcomer reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell tacaswell modified the milestones: v3.11.0, v3.10.2 Apr 3, 2025
@tacaswell

tacaswell commented Apr 3, 2025

Copy link
Copy Markdown
Member

This and #29816 will need to be backported to 3.10.x.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@QuLogic
QuLogic force-pushed the test-reduction branch from 2fcf79b to 45089d9 Compare April 3, 2025 21:42
tacaswell
tacaswell approved these changes Apr 4, 2025
View reviewed changes
tacaswell
tacaswell reviewed Apr 4, 2025
View reviewed changes
Comment thread lib/matplotlib/tests/test_figure.py Outdated
@@ -25,7 +25,7 @@
import matplotlib.dates as mdates


@image_comparison(['figure_align_labels'], extensions=['png', 'svg'],
@image_comparison(['figure_align_labels.png'],

@tacaswell tacaswell Apr 4, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe this one should stay. @anntzer 's comments in 19359c1 when the pdf version was removed suggest that this was testing some of the fixed-dpi issues we have with vector formats.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@QuLogic QuLogic Apr 4, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sure, can revert. That commit also has some backcompat stuff that maybe could be removed in #29816, looks like...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@QuLogic
QuLogic force-pushed the test-reduction branch from 45089d9 to 6d9c808 Compare April 4, 2025 06:08
QuLogic and others added 3 commits April 4, 2025 02:34
@QuLogic
TST: Remove unnecessary test images
8ff9a77
There's no need to test multiple file formats for tests that:

- are for wrappers that simplify or combine other primitives, such as
  `boxplot`, `eventplot`, `axhspan`, or `fill_between`.
- are for spine or tick settings, such as the `autoscale_tiny_range`,
  `formatter_ticker_*`.
- are for alternate Axes projections, such as polar, Mollweide, or
  skewed Axes.
@QuLogic
TST: Set check_figures_equal default to PNG only
4b51837
@tacaswell @timhoffm @QuLogic
DOC: clarify when to use multiple extensions
44bc05c
Co-authored-by: Tim Hoffmann <[email protected]>
@QuLogic
QuLogic force-pushed the test-reduction branch from 6d9c808 to 44bc05c Compare April 4, 2025 06:34
timhoffm
timhoffm approved these changes Apr 4, 2025
View reviewed changes
@timhoffm
timhoffm merged commit 662239c into matplotlib:main Apr 4, 2025
@lumberbot-app

lumberbot-app Bot commented Apr 4, 2025

Copy link
Copy Markdown

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.10.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 662239c31e3a080e9bcbe69cd51452a9c0506d97
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #29827: TST: Remove unnecessary test images'
  1. Push to a named branch:
git push YOURFORK v3.10.x:auto-backport-of-pr-29827-on-v3.10.x
  1. Create a PR against branch v3.10.x, I would have named this PR:

"Backport PR #29827 on branch v3.10.x (TST: Remove unnecessary test images)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lumberbot-app lumberbot-app Bot added the Still Needs Manual Backport label Apr 4, 2025
@QuLogic
QuLogic deleted the test-reduction branch April 4, 2025 22:15
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Apr 5, 2025
@QuLogic
Backport PR matplotlib#29827: TST: Remove unnecessary test images
2f88659
@QuLogic QuLogic added the topic: testing label Apr 5, 2025
@QuLogic QuLogic mentioned this pull request Apr 5, 2025
Backport PR #29827 on branch v3.10.x (TST: Remove unnecessary test images) #29867
Merged
1 task done
@QuLogic QuLogic removed the Still Needs Manual Backport label Apr 5, 2025
dstansby pushed a commit to QuLogic/matplotlib that referenced this pull request Apr 24, 2025
@QuLogic @dstansby
Backport PR matplotlib#29827: TST: Remove unnecessary test images
59a9774
ksunden added a commit that referenced this pull request May 2, 2025
@ksunden
Merge pull request #29867 from QuLogic/auto-backport-of-pr-29827-on-v…
0595366
…3.10.x

Backport PR #29827 on branch v3.10.x (TST: Remove unnecessary test images)
@ksunden ksunden mentioned this pull request May 9, 2025
merge up 3.10.3 #30031
Closed
5 tasks
@QuLogic QuLogic added this to Font and text overhaul Jun 5, 2025
@github-project-automation github-project-automation Bot moved this to Waiting for other PR in Font and text overhaul Jun 5, 2025
@QuLogic QuLogic moved this from Waiting for other PR to Done in Font and text overhaul Jun 5, 2025
@ksunden ksunden mentioned this pull request Jul 25, 2025
Manual Backport PR #30195 on branch v3.10.x (ci: Enable wheel builds on Python 3.14) #30356
Merged
5 tasks
@ksunden ksunden mentioned this pull request Aug 7, 2025
merge up v3.10.5 #30401
Merged
5 tasks
ksunden pushed a commit to ksunden/matplotlib that referenced this pull request Aug 21, 2025
@QuLogic @ksunden
Backport PR matplotlib#29827: TST: Remove unnecessary test images
4256ead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tacaswell tacaswell tacaswell approved these changes
@timhoffm timhoffm timhoffm approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Documentation: devdocs files in doc/devel topic: mplot3d topic: testing

Projects

Font and text overhaul
Status: Done

Milestone

v3.10.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@QuLogic @tacaswell @timhoffm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.