Skip to content

image compare animations for testing #11839

Closed as not planned
Closed as not planned

Description

@t-makaro

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.

Activity

  1. changed the title [-]Pytesting animations[/-] [+]image compare animations for testing[/+] on Aug 10, 2018
  2. added this to the v3.1 milestone on Aug 11, 2018
  3. tacaswell commented on Aug 11, 2018

    @tacaswell
    Member

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

  4. t-makaro commented on Aug 11, 2018

    @t-makaro
    ContributorAuthor

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

  5. tacaswell commented on Aug 11, 2018

    @tacaswell
    Member
  6. t-makaro commented on Aug 23, 2018

    @t-makaro
    ContributorAuthor

    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.

  7. modified the milestones: v3.1.0, v3.2.0 on Mar 18, 2019
  8. modified the milestones: v3.2.0, v3.3.0 on Aug 26, 2019
  9. modified the milestones: v3.3.0, v3.4.0 on Apr 30, 2020
  10. modified the milestones: v3.4.0, v3.5.0 on Jan 27, 2021
  11. modified the milestones: v3.5.0, v3.6.0 on Sep 25, 2021
  12. modified the milestones: v3.6.0, v3.7.0 on Aug 24, 2022
  13. github-actions commented on Aug 21, 2024

    @github-actions

    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!

  14. added
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actiontopic: testing

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions