Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#42 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
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
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PlanetFormationLab/eddy 的其他 Issue

查看 PlanetFormationLab/eddy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。