Follow-up to the PEtab fixes: three valid jobs are refused, by checks added in PRs #940 and #943 and by numbered BNGL action lines that PyBNF does not recognise
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reproducing the three cases described for PEtab export and numbered BNGL actions, comparing behavior on main and the referenced PR branches. Inspect export_job and the BNGLModel action scanner in pybnf/pset.py. Done means valid near-equal doses, molecule components named time, and numbered actions are handled without refusing or silently dropping valid work, with regression tests for each case.
由索引模型根据 Issue 内容生成。
描述
Three checks refuse jobs that PyBNF should handle. None of them gives a wrong result without a message; each stops a job that is valid. Two of the checks were added by the PEtab fixes in open PRs #940 and #943, so they reach users once those PRs merge. The third is older: PyBNF does not recognise BNG's numbered action lines. On main that makes every simulation fail, and PR #944's export refuses the same file. Each is described below with the fix.
1. PR #943: two doses one float step apart are refused as "near-duplicates"
A parameter-scan experiment with two replicate files, where one file writes the dose as 0.3 and the other as 0.30000000000000004 (the same number after a floating-point sum), is refused by the PEtab export:
edition = 2
model: m.bngl
experiment: dr, data: ulp1.exp, ulp2.exp
uniform_var = kd 0.1 10
uniform_var = kb 0.1 10
ulp1.exp is # L A_tot B_tot / 0.3 0.15 0.1 / 1 0.5 0.45, and ulp2.exp is # L A_tot B_tot / 0.30000000000000004 0.16 0.1.
On #943's branch, export_job raises: "Experiment 'dr' has two distinct doses L = 0.3 (in 'ulp1.exp') and L = 0.30000000000000004 (in 'ulp2.exp') that differ by less than the fitter's dose-matching tolerance (relative 1e-05) …". main exports the job, with both rows under dr_0 at L = 0.3.
The refusal exists because the fitter matches a data row to a simulated dose within a relative 1e-5 (np.isclose, rtol = 1e-5). Between two doses that close but distinct, the fitter and a PEtab tool can pair a measurement with different simulations. For doses one or a few floating-point steps apart, however, both simulations are the same to machine precision, so exporting them as one dose is exact.
Fix: treat doses equal to within a few units in the last place as one dose, and refuse only above that, up to the fitter's tolerance.
2. PR #940: a molecule component named time is taken to mean the model reads the clock
PR #940 refuses to export a fixed-duration equilibration (equil_t_end:) for a model that reads the simulation time. Its detector also fires on a molecule type with a component named time:
begin molecule types
A()
T(time~0~1)
end molecule types
...
begin reaction rules
0 -> A() kp
A() -> 0 k*flag
T(time~0) -> T(time~1) kf
end reaction rules
with experiment: relax, preequilibrate: pre, condition: meas, equil_t_end: 0.1, data: relax.exp.
On #940's branch, export_job raises "… on model 'm.bngl', which reads the simulation time (the 'time' symbol (time() or a time-indexed tfun)) …". The model never reads time: time is a component name here.
Fix: match time() as a function call, a time-indexed tfun, or the name used in an expression, and never inside a species or molecule-type pattern.
3. Numbered action lines (1 generate_network(...)) are not recognised
BNG2.pl accepts a line index in front of an action, and runs this file without complaint:
begin actions
1 generate_network({overwrite=>1})
2 simulate({method=>"ode",t_end=>5,n_steps=>5})
end actions
PyBNF's action scanner matches generate_network only at the start of the line, so it treats 1 generate_network(...) as an ordinary action. The effect differs by branch:
- On
main, an edition-2 fit of this model (experiment: tc, data: tc.exp, a first-order decay) keeps that line in every evaluation's model. There it runs against the.netfile PyBNF has already generated, and BNG2.pl aborts every simulation with "Nothing to do: no reaction rules defined". The fit ends "Fitting complete" with objective inf, and the reason is only in each simulation's log. - On PR #944's branch, the export refuses the model, calling both lines actions "that the fit runs before its experiments but the PEtab export would drop".
- On
main, the export drops both lines, including thegenerate_network.
Fix: strip a leading line index when scanning actions (BNGLModel in pybnf/pset.py), so a numbered generate_network is recognised as one and a numbered simulate as a simulation action. The planned edition-2 rule that refuses hand-written state-changing actions at load should use the same scanner.
Found while fixing the PEtab issues #892–#908 (2026-09-25). Items 1 and 2 were reproduced on the PR branches, and item 3 on main at cd2be675 and on #944's branch.
- 主要语言
- 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 ·