job_type = ms silently drops an atol=>/rtol=> that is not a plain number, and no path refuses a negative or non-finite atol

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Read _run_kwargs in pybnf/shooting/net_backend.py and compare its tolerance handling with _eval_numeric in net_model.py:1755; also inspect segment.py:125 for the other path. Add coverage for expression tolerances and negative or non-finite atol values. Done means multiple shooting evaluates tolerances consistently and invalid atol values are rejected with the action named.

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

描述

bug silent-incorrectness

Multiple shooting drops a tolerance it cannot parse. In job_type = ms, _run_kwargs (pybnf/shooting/net_backend.py:253-258) calls float() on each tolerance:

for key in ('atol', 'rtol'):
    if key in self.sim_params:
        try:
            kwargs[key] = float(self.sim_params[key])
        except (TypeError, ValueError):
            pass

The ordinary .net path evaluates the same value with _eval_numeric (net_model.py:1755). So an expression tolerance such as atol=>1e-6/10 is honoured by a fit and silently dropped by multiple shooting, which then integrates at bngsim's default.

No path checks a bad atol. PyBNF does not check a negative or non-finite atol on any path (net_model.py:1755, segment.py:125, net_backend.py). What happens is up to bngsim.

#1018 fixed both of these. It was closed for an unrelated reason (it also wrapped tolerances in ExactAtol, which was not wanted), so the fixes did not land.

Fix: evaluate the tolerance as the ordinary path does, and refuse a value that is not a finite number ≥ 0, naming the action.

主要语言
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 摘要。