matplotlib / matplotlib/pytest-mpl

Roadmap for `v1.0.0`

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

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

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

説明

I reviewed all the configuration options which are used in the code and found quite a few inconsistencies. I have listed proposed fixes for them, separated into breaking and non-breaking changes. We can add warning for the breaking changes now, and then change in v1.0.0.

Let's discuss these lists. Are there any items which should be added or removed? For the breaking changes, how long of a warning period should we have? For any of them, should we only start warning in v1.0.0 and then change in v1.1.0?

Review of configuration options

Option kwarg CLI ini default
Enable testing N/A --mpl N/A False
Enable baseline image generation, at specified directory path (relative to where pytest was run) N/A --mpl-generate-path N/A None
Enable baseline hash generation, at specified file path (relative to where pytest was run) N/A --mpl-generate-hash-library N/A None
Directory containing baseline images
(relative to the test file)
baseline_dir --mpl-baseline-path
(relative to where pytest was run)
baseline/
Whether --mpl-baseline-path should also be relative to the test file N/A --mpl-baseline-relative N/A False
Filename of the baseline image filename N/A N/A test name
Whether to include the module name in the baseline image filename ? mpl-use-full-test-name False
File containing baseline hashes
(relative to the test file)
hash_library --mpl-hash-library no hash comparison
RMS tolerance tolerance 2
Whether to standardise metadata deterministic True (PNG: False)
kwargs to pass to savefig savefig_kwargs N/A N/A {}
Matplotlib style style classic
Whether to remove axis tick labels remove_text False
Matplotlib backend backend agg
Directory to write testing artifacts to
(relative to where pytest was run)
N/A --mpl-results-path mpl-results-path temp dir
Whether to save result images for passing tests N/A --mpl-results-always mpl-results-always False (True if generating a HTML summary)
Which test summaries to generate, if any N/A --mpl-generate-summary={html,json,basic-html} None
Notes
  1. N/A are options which we don't think should exist.
  2. Empty boxes are options which we do think should exist.
  3. ? are options which could exist but would be of limited use.
  4. Due to how paths are computed by Python, the baseline directory and hash library paths can be absolute. In this case --mpl-baseline-relative and what directory the paths are interpreted to be relative to does not have any effect.
  5. Path specified in kwargs should be relative to the test file, and paths specified in CLI and ini options should be relative to where pytest was run.

Non-breaking changes

  • Document that backend can be specified. #199
  • Document the option to use the full test name. #199
  • Document that mpl-use-full-test-name ini overrides the filename kwarg. #199
  • Add mpl-baseline-path ini option (relative to where pytest was run). #181
  • Expand mpl-use-full-test-name ini option to CLI (and maybe kwarg). #181
  • Add mpl-hash-library ini option (relative to where pytest was run). #181
  • Add --mpl-default-tolerance CLI and mpl-default-tolerance ini options. #181
  • Add CLI and ini options for deterministic. #197
  • Add --mpl-default-style CLI and mpl-default-style ini options. #181
  • Add CLI and ini options for remove_text.
  • Add CLI and ini options for backend. #181
  • Add generate-summary ini option for generating test summaries. #181

Breaking changes

  • --mpl-hash-library should be relative to where pytest was run (to match --mpl-baseline-path).
  • Local hash_library kwarg should take precedence over global --mpl-hash-library CLI option. #154
  • Deprecate the use of multiple hash libraries in the same pytest run (not necessary because files are small and include the full module path anyway). #154
  • Deprecate the use of multiple testing modes in the same pytest run (e.g. warn if one test only has hash comparison while the others only have image comparison)
  • Use Matplotlib's default style instead of 'classic'.
  • Change the default RMS tolerance to 0.
  • Enable deterministic PNG files by default.
  • Deprecate remove_text kwarg and replace with better named remove_ticks_and_titles
  • (???) Add a remove_text kwarg that actually removes all text.
  • (???) Rename baseline_dir/--mpl-baseline-path to have consistent name.

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

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

はじめの一歩

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

調査の方向性

まず設定オプションと、この Issue に記載されている未解決の breaking および non-breaking の変更を確認し、その後、参照されている remove_text エントリーポイントの pytest_mpl/plugin.py を調査します。実装を開始するには、Issue のスコープ、警告期間、デフォルト値について maintainer の判断が必要です。完了には、合意されたロードマップと対応する変更が必要になります。

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

評価

技術スタック
python
領域
testing-qa
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

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

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