default savefig format

未關閉
#152 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@bjlittle 已經在處理了。

開始於 2022年5月21日。

  • #160 來自 @bjlittle —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
48/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
matplotlib, python
領域
testing-qa

研究方向

從 pytest_mpl/plugin.py 中 419–421 行附近連結的 savefig 呼叫開始,接著追蹤 savefig_kwargs 如何來自 marker 裝飾器。檢查記憶體中的緩衝區如何處理,並驗證預設格式為 PNG,同時呼叫端提供的格式保持不變。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
274
分支
53
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

matplotlib/pytest-mpl 的其他 Issue

查看 matplotlib/pytest-mpl 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。