continue_run applies adaptive_files/MLE_params.txt by position, with no check of its length or of which parameter each value belongs to

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
numpy, python
领域
data

调研方向

Read pybnf/algorithms/samplers/base.py around lines 371–374 and pybnf/algorithms/samplers/adaptive_mcmc.py around lines 283 and 630 to trace how MLE values are saved and loaded. Check the existing tests for continue_run and how configuration parameter names are represented. Done when loading rejects a count or name mismatch with a clear error, and a one-parameter file loads without an indexing error.

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

描述

bug silent-incorrectness

adaptive_files/MLE_params.txt holds values only, with no parameter names (written by np.savetxt at pybnf/algorithms/samplers/adaptive_mcmc.py:630). continue_run = 1 applies those values by position (pybnf/algorithms/samplers/base.py:371-374; adaptive_mcmc.py:283). Nothing checks the file against the configuration:

  • Too many values: an extra value is silently dropped.
  • Reordered declarations: if the uniform_var lines are reordered between runs, or the file is permuted, every chain starts from the wrong values, possibly outside the boxes, with no error.
  • One free parameter: np.loadtxt returns a 0-d array, so self.mle_start[i] should raise "too many indices". The 0-d return is confirmed; the full continue_run run is not.

#1013 covers the same problems for starting_params; this is the continue_run side. It was found in independent review of the #984 follow-ups.

Fix: write the names, and on load check the count and the names against the configuration. Refuse a mismatch, naming it.

主要语言
Python
星标
25
派生
25
平均合并
4 小时 5 分钟
30 天内合并 PR
10

环境准备

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

从这里开始

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

lanl/PyBNF 的其他 Issue

查看 lanl/PyBNF 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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