A constraint's suffix.observable reference is resolved only once simulations run: an ambiguous suffix is accepted at load, and a gradient fit names a different cause
还没有人认领这个 Issue。
评估
调研方向
Start with Constraint variable lookup in pybnf/constraint.py and gradient_base.scored_suffixes, then trace when constraint references are resolved during configuration loading. Use the two-model reproduction with duplicate q outputs and a dotted reference such as q.A_tot to check the behavior. Done means loading rejects references that match zero or multiple models and names the suffix and producing models.
由索引模型根据 Issue 内容生成。
描述
What you do. Fit two models that both write an output with the same suffix, say q. Attach a constraint to one of them that reads that output by name, for example a tc.prop on model m1 containing q.A_tot < 50 at q.time=2 weight 1.
What you see. The configuration loads and the fit is set up. Then it depends on the fit type:
job_type = destops at its first simulation with "Suffix 'q' in your constraint file appears in multiple model files. Please change your suffix names so it isn't ambiguous".job_type = gntr, wherem2'sqis anssarun, is refused as it is set up. The message is that it "cannot differentiate the scored output 'q' of model 'm2': it is written by a simulate run with method 'ssa'". It does not mention the ambiguity, which is the actual problem. Both models'qcount as read by the constraint, because asuffix.observablereference is matched against every model's outputs.
Both runs stop, so no wrong result is reported. But the name is resolved only against the simulated output, after the configuration has been accepted. Under refine_method = gntr or refine_method = ms, a refusal that depends on this would come after the whole search.
What should happen. When the configuration loads, each suffix.observable reference in a constraint file should resolve to exactly one model's output. If it resolves to none or to more than one, the configuration should be refused, naming the suffix and the models that produce it.
Where. Constraint's variable lookup in pybnf/constraint.py (the "appears in multiple model files" check) runs against the simulation data dictionary at evaluation time. gradient_base.scored_suffixes (from #1057) adds a dotted reference's suffix to every model that can produce it.
Reproduction. Two copies of a decay model, each with simulate({method=>...,suffix=>"q"}) and then resetConcentrations() and an ODE simulate(...suffix=>"tc"). The q run is ode in m1.bngl and ssa in m2.bngl. The job:
edition = 2
bngl_backend = bngsim
model = m1.bngl : a/tc.exp, a/tc.prop
model = m2.bngl : b/tc.exp
objective = sos
uniform_var = k_deg 0.1 10
job_type = de
a/tc.prop holds q.A_tot < 50 at q.time=2 weight 1.
Found during review of the multiple-shooting batch (fix/ms-batch). The de behaviour is the same on main.
- 主要语言
- Python
- 星标
- 26
- 派生
- 25
- 平均合并
- 4 小时 25 分钟
- 30 天内合并 PR
- 9
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lanl/PyBNF 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse it未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
-
bug minor
难度 1/5 1-3 小时 新手友好度 92/100
-
bug minor
难度 2/5 1-3 小时 新手友好度 76/100
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复