Matplotlib deprecation warning
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- matplotlib, python
調査の方向性
非推奨の呼び出しは cmocean/cm.py にあり、colors.ListedColormap が N 引数付きでインスタンス化されています。再現するには、issue のスニペットを実行し、インポート時に MatplotlibDeprecationWarning が出ることを確認してください。それらのインスタンス化から N 引数を削除し、cmocean のインポート時に非推奨警告が出なくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Error description
Importing cmocean gives a Matplotlib deprecation warning. MWE to reproduce the issue:
import warnings
import matplotlib
# Import the specific warning class from matplotlib
from matplotlib import MatplotlibDeprecationWarning
print(f"Testing environment with Matplotlib version: {matplotlib.__version__}")
# Force this specific warning to always print for testing purposes
warnings.simplefilter('always', MatplotlibDeprecationWarning)
try:
# This import triggers the internal loop in cmocean/cm.py
import cmocean
print("cmocean imported successfully (check above for warnings).")
except MatplotlibDeprecationWarning as e:
print(f"Caught the expected warning as an error: {e}")
Proposed fix
The N parameter can be omitted from the colors.ListedColormap instantiations inside cmocean/cm.py, as the passed color arrays (rgb_with_alpha and its reversed slice) are already scaled to the proper lengths (rgb.shape[0] and rgb_i.shape[0]).
- 主要言語
- Python
- スター
- 272
- フォーク
- 54
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matplotlib/cmocean のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
matplotlib/cmocean#120 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
matplotlib/cmocean#119 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
matplotlib/cmocean#118 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
matplotlib/cmocean#116 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
matplotlib/cmocean#115 ·
matplotlib/cmocean の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/markitdown#2820 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
yt-project/yt#5624 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#148376 ·
メンテナーはふだん 1 日以内に返信