matplotlib / matplotlib/pytest-mpl

Support check_figures_equal style comparison without any baseline_image

Open
#94 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
272
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Hi there,

First off, thanks for the great plugin! Just a long time user over at PyGMT and we've being using pytest-mpl quite extensively to catch lots of bugs 😄

Anyhow, we're just wondering if there's scope here for something like @pytest.mark.mpl_check_equal based on matplotlib's check_figures_equal function for "generating and comparing two figures" (fig_ref and fig_test) on the fly (without having a baseline image).

The main use case for this is to keep our repository size small, since the baseline images can take up a lot of space. Currently, pytest-mpl does something similar to matplotlib's image_comparison decorator function. We've been putting some thought into this at https://github.com/GenericMappingTools/pygmt/pull/555, and rather than duplicating work, we're wondering if the logic could sit here in pytest-mpl or somewhere in the matplotlib organization.

Happy to submit a PR if someone can point me in the right direction.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating pytest-mpl’s existing image-comparison implementation and compare its entry points with Matplotlib’s check_figures_equal and image_comparison decorators. Define how a marker would generate fig_ref and fig_test without baseline images, then verify that the two figures are compared and that repository image fixtures are unnecessary.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.