matplotlib / matplotlib/pytest-mpl

result_image redundancy

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

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

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

説明

In the plugin.ImageComparison.compare_image_to_hash_library method, during hybrid-mode, the result_image appears to be unnecessarily copied into the summary dictionary from the outcome of plugin.ImageComparison.compare_image_to_baseline:

https://github.com/matplotlib/pytest-mpl/blob/e3876180847c2d04aeda1982372074998a7f8716/pytest_mpl/plugin.py#L571-L573

i.e., the summary['result_image'] has already been correctly set within plugin.ImageComparison.compare_image_to_hash:

https://github.com/matplotlib/pytest-mpl/blob/e3876180847c2d04aeda1982372074998a7f8716/pytest_mpl/plugin.py#L551-L554

If this is the case, are you happy for me to remove this behaviour?

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

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

はじめの一歩

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

調査の方向性

pytest_mpl/plugin.py の ImageComparison.compare_image_to_hash_library と compare_image_to_baseline から始め、特に 551-554 行および 571-573 行付近の参照された行を確認してください。hybrid-mode が summary['result_image'] にどのように値を設定するかを確認し、その前の代入で十分な場合に限って冗長な動作だけを削除し、画像比較の動作が変わらないことを検証してください。

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

評価

技術スタック
python
領域
testing
issue の種類
リファクタリング
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

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

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