A malformed noise_model line is reported as "noise_model is not a valid configuration key", and every config parse error reports the line before the right one
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从pybnf/parse.py开始:检查第876行附近的配置解析循环和第1359行附近的格式提示分支,然后查找涵盖格式错误配置值的解析器测试。使用 issue 中格式错误的noise_model行,在examples/tutorial/36_estimate_noise/estimated_sigma.conf中复现问题。完成标准是:错误信息指出正确的从1开始计数的行号,区分未知键与已知键的无效值,并且测试覆盖这些情况。
由索引模型根据 Issue 内容生成。
描述
Writing a fixed noise level as a bare number is an easy mistake:
noise_model = normal, sigma = 4
The correct form is sigma = fix_at 4. PyBNF reports the mistake as
Error: Parsing configuration key 'noise_model' on line 42.
noise_model is not a valid configuration key.
Both parts of the message are wrong.
-
noise_modelis a valid key. The value is what failed to parse. Inpybnf/parse.py, after a line fails the grammar, a chain ofelif key == ...branches picks a format hint for the key. A key with no branch falls through tofmt == ''and gets "is not a valid configuration key". The comment on thedatabranch (around line 1359) describes this same problem fordataand fixes it for that one key only.noise_modelhas no branch, and neither does any other real key not in the chain. -
The line number is off by one. With the reproduction below, the
noise_modelline is line 43 of the file (grep -nagrees), and the message says 42. The number is the indexifromfor i, line in enumerate(ls)(around line 876), which counts from 0. Every message built from it, including theMisconfigured config key ... at line: {i}text, points at the line before the one at fault.
Reproduction: in examples/tutorial/36_estimate_noise/estimated_sigma.conf, replace the noise_model line with noise_model = normal, sigma = 4, delete the loguniform_var = noise_level ... line, and run pybnf -c on it.
Suggested fix: report a line number counted from 1. When the key is a real configuration key but its value does not parse, say so and give the accepted forms, as the data branch does. Use "is not a valid configuration key" only for a key PyBNF does not know. A test that runs every known key with a malformed value through the parser would keep the next new key from falling through.
- 主要语言
- Python
- 星标
- 25
- 派生
- 25
- 平均合并
- 4 小时 5 分钟
- 30 天内合并 PR
- 10
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lanl/PyBNF 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug tech debt
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug silent-incorrectness
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findings未关闭harness
难度 2/5 1-3 小时 新手友好度 72/100
mruangutai/harness#2455 ·
维护者通常 1 天内回复
-
stripthink leaves thinking text in place when the chat template opens the think tag in the prompt可能已有人在做 @MaiAditya 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the run可能已有人在做 @BioGeek 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
instadeepai/winnow#312 ·