A continue=>1 simulate into a new suffix makes BNG2.pl write its .gdat without a header, and PyBNF reads the first data row as the header, so every evaluation on bngl_backend = bionetgen fails

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start with pybnf.data.Data, the loader that takes the first data row as the header when a .gdat file has none, and with the BNG2.pl output path for simulate actions that use continue=>1 and a new suffix. Reproduce with the decay model and actions block in the issue, then check that m_tc.gdat loads with time and Atot columns and keeps all rows. Done when the header is restored from the continued run or the load is refused with the action named.

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

描述

When a BNGL simulate with continue=>1 writes to a new suffix, BNG2.pl (2.9.3) writes that suffix's .gdat with no header line and no start row. It treats the file as the continuation of an existing output. PyBNF's loader (pybnf.data.Data) reads such a file by taking its first data row as the column header. The result:

  • one row is lost;
  • the columns are named by numbers instead of time and the observables;
  • so under bngl_backend = bionetgen, every evaluation of an experiment scored on that suffix fails.

The run then ends like any job whose simulations fail: "Fitting complete" at an objective of inf, or "Your simulations are failing to run". The cause appears only in the logs (see #995). The bngsim bridge writes a normal output for the same action.

Reproduction

PyBNF main (31ead5f3), BNG2.pl 2.9.3. The model is a decay A() -> 0 (rate 0.1, A() seeded at 1000, Molecules Atot A()), with this actions block:

generate_network({overwrite=>1})
simulate({method=>"ode",t_end=>5,n_steps=>5,suffix=>"eq"})
simulate({method=>"ode",continue=>1,t_end=>10,n_steps=>5,suffix=>"tc"})

BNG2.pl writes m_eq.gdat with a header, and m_tc.gdat without one:

 6.000000000000e+00  5.488115943337e+02
 7.000000000000e+00  4.965852514474e+02
 ...

Loading them with PyBNF:

from pybnf.data import Data
Data(file_name='m_eq.gdat').cols   # {'time': 0, 'Atot': 1}, 6 rows
Data(file_name='m_tc.gdat').cols   # {'6.000000000000e+00': 0, '5.488115943337e+02': 1}, 4 rows (t = 6 lost)

Any data scored on tc then finds no time or Atot column.

Expected

Do one of these:

  • When PyBNF reads BNG2.pl output for an action with continue=>1 whose suffix has no earlier output, supply the header of the run it continues (same columns) and keep every row.
  • Or refuse a continue=>1 into a new suffix under bngl_backend = bionetgen at load, naming the action.

Seen independently in the reviews of #1005 and #1011.

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