Support `cf.Data` (consistently) for numeric array inputs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start with cfplot/stipple.py at the failing call shown in the traceback, then search the plotting functions for numeric array inputs that handle cf.Data inconsistently. Compare how those functions accept array-like values and identify where cf.Data needs to be accepted directly. Done when numeric inputs consistently accept cf.Data without requiring callers to use .array or .datum(), and Example 17 no longer needs that conversion.
索引モデルが issue の本文から書いたものです。
説明
There are places in cf-plot where one can input a numeric value or array. In all such cases we should support a cf.Data object input - in fact this should generally be our preferred object, at least in terms of being top to encourage this in the docs, though under-the-hood support should be 'equal' in terms of allowed any array with a numpy-like interface. At present there is patchy support for this, but we should consistently accept cf.Data and extract the underlying array (only) when necessary from this, rather than requiring the user to ever call .array etc. to then input that.
MRE of a case without support at present
One example, that I doubt is a lone case, where cf.Data input fails:
>>> f = cf.read("docs/source/example-datasets/tas_A1.nc")
>>> g = f[0][-1, :, :]
>>> g
<CF Field: air_temperature(time(1), latitude(73), longitude(96)) K>
>>> minim = g.min().datum() # this works, with .datum() conversion
>>> cfp.gopen()
>>> cfp.con(g, lines=False) # need this for now to not run into Issue #151
>>> cfp.stipple(g, min=minim, max=400)
>>> cfp.gclose()
>>>
>>> minim = g.min() # this does not work, without .datum() conversion
>>> cfp.stipple(g, min=minim, max=400) # otherwise the same call, hangs for ~10s then errors
Traceback (most recent call last):
File "<python-input-24>", line 1, in <module>
cfp.stipple(g, min=minim, max=400)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/slb93/git-repos/cf-plot/cfplot/stipple.py", line 169, in stipple
plotvars.mymap.scatter(
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'scatter'
See also Example 17 which shows datum() having to be called, where resolution of this Issue would make it unnecessary: https://github.com/NCAS-CMS/cf-plot/blob/main/docs/source/examples/example_17.rst#example-17-basic-stipple-plot
- 主要言語
- Python
- スター
- 21
- フォーク
- 11
- 平均マージ
- 3時間 7分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NCAS-CMS/cf-plot のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
dependencies infrastructure installation testing
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
docs enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
NCAS-CMS/cf-plot の issue をすべて見る
似ている issue
-
area: ci enhancement perceived difficulty: 1
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
vllm-project/vllm-sail#398 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
DiamondLightSource/sm-bluesky#476 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100