Skip to content

image compare animations for testing #11839

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

Closed
t-makaro opened this issue Aug 10, 2018 · 5 comments
Closed

image compare animations for testing #11839

t-makaro opened this issue Aug 10, 2018 · 5 comments
Labels
status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: testing

Comments

@t-makaro
Copy link
Contributor

t-makaro commented Aug 10, 2018

I'm currently trying to create pytests for animations over in animatplot. Now, I know that people here have talked about writing image comparison tests for animations, so I thought I would open an issue here to track progress, and to share what I am doing.

Now my needs for animatplot are fairly different, but essentially I'm going to wrap around matplotlib.testing.compare.compare_images, and use a custom file writer (which you can see here) to output a set of images. This file writer was inspired by @tacaswell's stackoverflow answer.

Once I get stuff working over there, I will be willing to help create these types of tests here.

@t-makaro t-makaro changed the title Pytesting animations image compare animations for testing Aug 10, 2018
@tacaswell tacaswell added this to the v3.1 milestone Aug 11, 2018
@tacaswell
Copy link
Member

https://github.com/matplotlib/pytest-mpl might also be interested in this feature.

@t-makaro
Copy link
Contributor Author

I'm very close to having everything working, but I'm having to remove the text to get things to compare properly on circleci. Which is fine for the most part, but for one of my tests I can't remove the text. I am getting a:

Could not set locale to English/United States. Some date-related tests may fail
    "Could not set locale to English/United States. "

message, but I don't think that is the issue.

I'm not sure what's causing the test to render so differently.
image

I am using matplotlib.testing.setup() which should set the font....

@tacaswell
Copy link
Member

@t-makaro
Copy link
Contributor Author

Alright, I have something that works for me over at animatplot. You can see my implementation here. It's as simple as using a decorator on a function that returns an animation. Internally, it will use the BunchOFiles writer to save the animation, and then loop over the images for comparison. Unfortunately, it does require specifying how many frames to expect.

This would require some additional work to suit matplotlib's needs.

@tacaswell tacaswell modified the milestones: v3.1.0, v3.2.0 Mar 18, 2019
@timhoffm timhoffm modified the milestones: v3.2.0, v3.3.0 Aug 26, 2019
@QuLogic QuLogic modified the milestones: v3.3.0, v3.4.0 Apr 30, 2020
@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Sep 25, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Aug 24, 2022
@QuLogic QuLogic modified the milestones: v3.7.0, future releases Jan 26, 2023
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Aug 21, 2024
@github-actions github-actions bot added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label Sep 20, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: testing
Projects
None yet
Development

No branches or pull requests

4 participants