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

verify_params_dictionary: vp_100/mstar check is inverted

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

Start in verify_params_dictionary in eddy/rotationmap.py (around L1236), where the vp_100 and mstar branches are inverted, and check where default_parameters.yml fills in mstar=1.0 before that check runs. Done means that setting both keys raises the ValueError, a power-law request with vp_100 set and mstar None selects _vpow without error, and a default mstar no longer blocks the power-law path. Related issue #36 touches the same block.

由索引模型根据 Issue 内容生成。

描述

Summary

The vp_100 / mstar check in verify_params_dictionary has its branches inverted.

# eddy/rotationmap.py, verify_params_dictionary, ~L1236
if params['vp_100'] is not None:
    if params['mstar'] is not None:
        params['vfunc'] = self._vpow
    else:
        raise ValueError("Cannot specify both `vp_100` and `mstar`.")
else:
    params['vfunc'] = self._vkep
  • Both vp_100 and mstar set: the power law is used silently. The error the message describes is never raised.
  • vp_100 set and mstar=None (a pure power-law request): this raises "Cannot specify both vp_100 and mstar", even though only one was specified.
  • vp_100 set, mstar left out: mstar defaults to 1.0 in default_parameters.yml, so this goes through the first branch and works. That is the only reason the power-law path appears to work. It also means the check can never tell an explicit mstar from the default.

Suggested fix

Swap the branches, and record whether mstar was supplied by the user before defaults are filled in, so that a power-law fit isn't rejected because of the default mstar=1.0. For example, check 'mstar' in params before the default-population loop, and raise only if both keys were given explicitly.

Related: #36 (same block; it never selects the pressure-corrected vfunc).

主要语言
Python
星标
23
派生
11
平均合并
28 分钟
30 天内合并 PR
1

环境准备

  • 没有 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 摘要。