matplotlib / matplotlib/pytest-mpl

Support check_figures_equal style comparison without any baseline_image

オープン
#94 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
272
フォーク
53
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi there,

First off, thanks for the great plugin! Just a long time user over at [PyGMT](https://github.com/GenericMappingTools/pygmt) and we've being using `pytest-mpl` quite extensively to catch lots of bugs :smile:

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](https://matplotlib.org/3.3.1/api/testing_api.html#matplotlib.testing.decorators.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`](https://matplotlib.org/3.3.1/api/testing_api.html#matplotlib.testing.decorators.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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず pytest-mpl に既存する画像比較の実装を見つけ、Matplotlib の check_figures_equal および image_comparison デコレーターとそのエントリーポイントを比較します。ベースライン画像なしで marker が fig_ref と fig_test をどのように生成するかを定義し、その後、2 つの Figure が比較され、リポジトリの画像 fixture が不要であることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。