Improve errors from `convert` function
まだ誰も着手していません。
評価
調査の方向性
cyprecice/cyprecice.pyx の convert 関数(15-24 行目)から始め、文字列が想定されている箇所に Enum メンバーを渡して失敗を再現します。受け取った型とサポートされている型を示すようにエラーの挙動を更新し、その後、結果のメッセージを issue の Interface の例と照合します。
索引モデルが issue の本文から書いたものです。
説明
The error return by the convert function is not helpful at the moment. I stumbled over this when I organized my participant names in an Enum
class ParticipantNames(Enum):
MASS_LEFT = "Mass-Left"
MASS_RIGHT = "Mass-Right"
One has to pass, for example, ParticipantNames.MASS_LEFT.value to the API. But I forgot the .values part, which led to an errors similar to
>>> precice.Interface(1,2,3,4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cyprecice/cyprecice.pyx", line 87, in cyprecice.Interface.__cinit__
File "cyprecice/cyprecice.pyx", line 24, in cyprecice.convert
TypeError: Could not convert.
I think it would be good to tell the user which type was received from the API and which types are supported here. If I would have known that I provided a <enum 'ParticipantNames'> instead of a <class 'str'> this would have helped me a lot debugging.
- 主要言語
- Cython
- スター
- 30
- フォーク
- 19
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
precice/python-bindings のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
precice/python-bindings#258 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
precice/python-bindings#255 ·
-
good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
precice/python-bindings#248 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
precice/python-bindings#238 · コメント 6 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
precice/python-bindings#209 ·
precice/python-bindings の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3312 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
needs-acceptance wg/data-plane-networking
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/semantic-router#4024 · コメント 1 件 ·
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
amponce/archive-movie-browser#165 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100