T3Species accepts a loose t3_status/thermo_method as a keyword and rejects it inside a dict
まだ誰も着手していません。
評価
調査の方向性
Read t3/chem.py around lines 232–263 to compare the keyword and dict constructor paths for T3Status and ThermoMethod. The issue leaves the intended behavior undecided: ask maintainers whether both paths should accept loose values or both should reject them, then check the chosen behavior against the examples in the report.
索引モデルが issue の本文から書いたものです。
説明
T3Species coerces t3_status and thermo_method leniently when they arrive as constructor
keywords, and strictly when the same values arrive inside a dict. The two paths disagree on the
same field of the same object.
Where
t3/chem.py on main (0bd0edc2):
- keyword path,
:240-246—T3Status(t3_status), thenT3Status(t3_status.lower()), then
T3Status.PENDING.thermo_methodhas the same shape at:232-238, falling back to
ThermoMethod.UNKNOWN. - dict path,
:262-263—ThermoMethod(val)andT3Status(val)with no lowercase retry and no
fallback, so a non-exact value raises.
Measured
ctor t3_status="Converged": OK -> <T3Status.CONVERGED: 'converged'>
ctor t3_status="nonsense": OK -> <T3Status.PENDING: 'pending'>
ctor thermo_method="qm": OK -> <ThermoMethod.UNKNOWN: 'Unknown'>
dict t3_status="Converged": ValueError: 'Converged' is not a valid T3Status
dict t3_status="converged": OK -> <T3Status.CONVERGED: 'converged'>
dict thermo_method="qm": ValueError: 'qm' is not a valid ThermoMethod
dict thermo_method="QM": OK -> <ThermoMethod.QM: 'QM'>
'Converged' is the exact capitalization T3Species.__repr__'s own docstring example displays, so
it is a plausible thing for a human to write into a file by hand.
Reach, and why this is low severity
as_dict always writes the enum's .value, so a dict T3 wrote itself always round-trips:
T3Species(species_dict=T3Species(..., t3_status='Converged').as_dict()) returns CONVERGED.
Counted over the tracked tree at 0bd0edc2: no committed .yml/.yaml/.json fixture carries
either key at all, and the only two literal values anywhere in tracked code reach the lenient
keyword path. So this is reachable only through a hand-written or externally produced dict, and
nothing in the repo exercises it today.
Fix is a choice, not a bug fix
Either the dict path reuses the keyword path's try/lower()/fallback, or the keyword path becomes
strict and the lenient fallback is dropped. The second silently turns a typo into PENDING today,
which is its own problem — but choosing between them is a call for T3's maintainers, not a
mechanical repair, which is why this is filed rather than patched.
- 主要言語
- Python
- スター
- 16
- フォーク
- 8
- 平均マージ
- 1時間 46分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ReactionMechanismGenerator/T3 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
ReactionMechanismGenerator/T3#233 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 53/100
ReactionMechanismGenerator/T3#239 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
ReactionMechanismGenerator/T3#237 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
ReactionMechanismGenerator/T3#236 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ReactionMechanismGenerator/T3#235 ·
ReactionMechanismGenerator/T3 の issue をすべて見る
似ている issue
-
docs(contributing): the two things that silently block a PR対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンavailable documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 95/100
Nixitov/Riptide-Native#944 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
JTHCode/secretguard#24 ·
メンテナーはふだん 1 日以内に返信
-
area: middleware documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 ·
メンテナーはふだん 1 日以内に返信