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

TST: Remove unnecessary test images#29827

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
timhoffm merged 3 commits intomatplotlib:mainfromQuLogic:test-reduction
Apr 4, 2025

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedMar 29, 2025
edited
Loading

PR summary

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

  • are for wrappers that simplify or combine other primitives, such asboxplot,eventplot,axhspan, orfill_between.
  • are for spine or tick settings, such as theautoscale_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

rcomer reacted with rocket emoji
@QuLogicQuLogic mentioned this pull requestMar 29, 2025
5 tasks
@QuLogic
Copy link
MemberAuthor

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

@QuLogic
Copy link
MemberAuthor

OK, I've also removedhist2d (because it is just apcolormesh), andmarkevery (because it's just a line + scatter).

@tacaswell
Copy link
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.

@tacaswelltacaswell added this to thev3.11.0 milestoneApr 1, 2025
@QuLogic
Copy link
MemberAuthor

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'sall 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.

@tacaswell
Copy link
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.

@timhoffm
Copy link
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.

@QuLogic
Copy link
MemberAuthor

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

@timhoffm
Copy link
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

@QuLogic
Copy link
MemberAuthor

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

@@ -677,8 +677,7 @@ def test_contains_points():
assert np.all(result == expected)


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

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?

Copy link
MemberAuthor

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.

@timhoffm
Copy link
Member

timhoffm commentedApr 3, 2025
edited
Loading

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

@tacaswelltacaswell modified the milestones:v3.11.0,v3.10.2Apr 3, 2025
@tacaswell
Copy link
Member

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

@@ -25,7 +25,7 @@
import matplotlib.dates as mdates


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

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 in19359c1 when the pdf version was removed suggest that this was testing some of the fixed-dpi issues we have with vector formats.

Copy link
MemberAuthor

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...

QuLogicand others added3 commitsApril 4, 2025 02:34
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.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@timhoffmtimhoffm merged commit662239c intomatplotlib:mainApr 4, 2025
39 of 41 checks passed
@lumberbot-appLumberbot (App)
Copy link

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.xgit 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 theStill Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free tosuggest an improvement.

@QuLogicQuLogic deleted the test-reduction branchApril 4, 2025 22:15
QuLogic added a commit to QuLogic/matplotlib that referenced this pull requestApr 5, 2025
dstansby pushed a commit to QuLogic/matplotlib that referenced this pull requestApr 24, 2025
ksunden added a commit that referenced this pull requestMay 2, 2025
…3.10.xBackport PR#29827 on branch v3.10.x (TST: Remove unnecessary test images)
@ksundenksunden mentioned this pull requestMay 9, 2025
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

3 participants
@QuLogic@tacaswell@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp