Silent skips and gaps on the bngsim bridges found while fixing #1051

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend, testing

调研方向

The issue names nf_model.py, net_model.py, parsing.py, pset.py, pybnf/_bngl_expr.py, and pybnf/petab/_bngl_math.py; start with one listed behavior and its corresponding bridge or parser entry point. Check the result against BNG2.pl where specified, and add a refusal test for unsupported inputs. Done means the selected discrepancy is fixed or refused clearly, with a test covering that behavior.

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

描述

bug silent-incorrectness

While fixing #1051, several older problems turned up on the bngsim bridges. Each one lets a model run with an action or value missing, reads something differently from BNG2.pl, or refuses a model that BNG2.pl runs. They are listed here so they can be fixed one at a time. Each needs either a refusal test or a fix checked against BNG2.pl.

Silent skips, where the bridge writes a log message and the run goes on:

  • nf_model.py, _apply_param_overrides: a parameter that NFsim does not accept is logged at debug level and skipped.
  • net_model.py: a setParameter on a parameter the model lacks is logged as a warning and skipped. The same happens to a setConcentration in a protocol block, and to an addConcentration in the action list or in a protocol.
  • nf_model.py, _nf_set_concentration_action: a setConcentration that would lower a count is logged and skipped. The bridge also adds molecules by molecule type only, so a pattern such as A(s~P) may not set the species that the pattern names. This needs checking against BNG2.pl.
  • nf_model.py: an action that the network-free loop has no handler for is skipped at debug level.
  • parsing.py, _parse_action_dict: an item without => is skipped at debug level.
  • pset.py: the regexes that read method, seed and suffix skip a quoted key. So "method"=>"ssa" does not mark the model as stochastic, and a data file bound to a quoted "suffix" is refused.

Read differently from BNG2.pl:

  • BNG2.pl evaluates a quoted t_end that names a parameter, such as t_end=>"2*tmax", against the model's parameters. The bridge refuses it.
  • PyBNF accepts an unquoted parameter name as an action argument, as in setConcentration("A()", L0). BNG2.pl rejects it ("Bareword not allowed while strict subs in use").
  • A # inside a quoted action argument: PyBNF's load check sees the line cut at the #, and BNG2.pl skips the whole line as unidentified input.
  • t_end=>sqrt 100, a Perl call without parentheses, passes the load check and then fails while running.
  • bngsim's stop condition (Simulator.add_stop_condition) evaluates the condition as Python over the observables alone, and passes over a row it cannot evaluate. #1051 refuses such conditions on the bridge, but the defect itself is in lanl/bngsim.

Refused although BNG2.pl runs it:

  • mratio is missing from pybnf/_bngl_expr.py, so 2 corpus models are refused on the network-free bridge.
  • _parse_bngl_param_block does not join backslash continuations, so 7 corpus models are refused on the network-free bridge, with a misleading message.

Duplication:

  • pybnf/petab/_bngl_math.py carries a second parser for BNGL arithmetic beside pybnf/_bngl_expr.py. The two could share one grammar.
主要语言
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 摘要。