matplotlib / matplotlib/pytest-mpl

default savefig format

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

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

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

説明

In the process of penning #150, I noticed that when capturing the test image to an io.Bytes in-memory buffer:

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

That the format kwarg to savefig isn't used.

Would you be adverse to defaulting to format='png', particularly when writing to a buffer, as (from what I understand) matplotlib will default to the rcParams to select the file-format to save to the buffer for the image, and this could be a source confusion/issues for hashing repeatability for developers when testing.

i.e., what I'm proposing is that a format='png' is injected into the savefig_kwargs, iff not specified by the caller as a kwarg option in the marker decorator.

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

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

はじめの一歩

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

調査の方向性

pytest_mpl/plugin.py の 419~421 行付近にあるリンク先の savefig 呼び出しから始め、次に savefig_kwargs が marker デコレーターからどのように渡されるかを追跡します。メモリ内バッファがどのように扱われるかを確認し、デフォルトの形式が PNG であり、呼び出し元が指定した形式は変更されないことを検証します。

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

評価

技術スタック
matplotlib, python
領域
testing-qa
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
48/100

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

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