Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fit_map: unknown/misspelled keys in params are silently ignored (e.g. m_disk vs mdisk)

オープン
#42 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
data

調査の方向性

Start in eddy/rotationmap.py at verify_params_dictionary (around line 1231), where the loop over default_parameters pops known keys and leaves everything else in params untouched. Reproduce with a misspelled key such as m_disk in a fit_map call and confirm that no warning is raised. Done when unknown keys produce a warning or error, internal flags like vfunc and vortex still pass, and a close-match hint such as mdisk appears where practical. Settle warn-versus-raise with the maintainer first.

索引モデルが issue の本文から書いたものです。

説明

Summary

verify_params_dictionary fills in defaults for the keys listed in default_parameters.yml and silently keeps any other key in params. A misspelled parameter name is therefore ignored rather than flagged. If that key is also mapped to a p0 index, the sampler walks a dimension the likelihood never sees.

Example

Writing m_disk where eddy expects mdisk:

params['r_in'] = 4
params['r_out'] = 4.0
params['m_disk'] = 5     # typo: should be 'mdisk'
params['gamma'] = 6
p0 += [1.0, 0.0, 1.0]
samples = cube.fit_map(p0=p0, params=params, ...)
  • mdisk gets its default (None), so _calc_mdisk returns 0 and the model is purely Keplerian.
  • m_disk takes slot 5 of p0 but never reaches the model, so it random-walks inside the walker spread. r_in and gamma are also unconstrained, because they are only used in _calc_mdisk.
  • The only output is the Assuming: p0 = [x0, y0, mstar, vlsr, r_in, m_disk, gamma] echo, which reads as if the fit is correct. The optimizer returns these three parameters unchanged from their starting values.

Nothing errors, and the fitted map looks plausible.

Where

eddy/rotationmap.py, verify_params_dictionary (~L1231):

for p in self.default_parameters.keys():
    params[p] = params.pop(p, self.default_parameters[p]['default'])

Suggested fix

After populating the defaults, warn (or raise) on any key that is not in default_parameters and is not an internal flag (vfunc, vortex, beam, ...). Raising is probably right whenever an unknown key is mapped to a p0 index, since that dimension can never be constrained. A difflib close-match suggestion ("did you mean mdisk?") would make the message more useful.

主要言語
Python
スター
23
フォーク
11
平均マージ
28分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PlanetFormationLab/eddy のほかの issue

PlanetFormationLab/eddy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。