You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
I am using matplotlib.testing.setup() which should set the font....
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.
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!
Activity
[-]Pytesting animations[/-][+]image compare animations for testing[/+]tacaswell commentedon Aug 11, 2018
https://github.com/matplotlib/pytest-mpl might also be interested in this feature.
t-makaro commentedon Aug 11, 2018
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:
message, but I don't think that is the issue.
I'm not sure what's causing the test to render so differently.

I am using
matplotlib.testing.setup()which should set the font....tacaswell commentedon Aug 11, 2018
Might be a freetype issue, see https://matplotlib.org/devel/contributing.html#building-matplotlib-for-image-comparison-tests
t-makaro commentedon Aug 23, 2018
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
BunchOFileswriter 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.
github-actions commentedon Aug 21, 2024
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!