A setOption written after generate_network is applied by a PyBNF fit but ignored by BNG2.pl, so PyBNF fits a different model from the one in the file
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with BNGLModel.__init__ and model_text() in pybnf/pset.py, then compare how the scanner handles setOption with the model text PyBNF generates. The issue lays out three possible behaviors but says a decision is needed, so first resolve that policy with the maintainers. Done means the chosen behavior is consistent between PyBNF and BNG2.pl and the reported ordering case is covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What the user writes. A BNGL model whose actions call generate_network first and setOption after it:
begin actions
generate_network({overwrite=>1})
setOption("MoleculesObservables","CountUnique")
simulate({method=>"ode",t_end=>4,n_steps=>4,suffix=>"tc"})
end actions
What happens. BNG2.pl applies the option only to a network generated after the setOption call. Run directly with BNG2.pl, this file counts its observables under the default rule (CountAll): the option comes too late and does nothing, and BNG2.pl prints no warning. PyBNF takes every setOption line out of the actions and puts it ahead of the actions block in the model text it simulates. So in a PyBNF fit the option does apply. The same file is two different models, depending on which program runs it, and neither program says so.
Consequence. In the example below the observable differs by a factor of two. A user who fits with PyBNF and then runs the best-fit parameters through BNG2.pl on their own file gets curves that do not match the fit.
What should happen. This needs a decision. The options I see:
- Refuse the file at load, in every edition (my recommendation). The message names the line and says that BNG2.pl does not apply a
setOptionthat followsgenerate_network, and to move it ahead. The user's intent is then unambiguous, and both programs agree. - Keep the user's order in the model text, so PyBNF matches BNG2.pl. Existing jobs written this way would change their results without notice.
- Leave the behaviour and document it.
Example
A dimer that decays at rate k = 0.5. Its observable pattern matches each dimer twice, so CountAll reports 100 e^(-kt) and CountUnique reports 50 e^(-kt).
begin model
begin parameters
k 0.5
end parameters
begin molecule types
A(a)
end molecule types
begin seed species
A(a!1).A(a!1) 50
end seed species
begin observables
Molecules D A(a!1).A(a!1)
end observables
begin reaction rules
A(a!1).A(a!1) -> 0 k
end reaction rules
end model
All four rows were run with BNG2.pl 2.9.3:
| Model text | D at t = 0 | D at t = 1 |
|---|---|---|
The file as written (setOption after generate_network) |
100 | 60.65 |
The file with no setOption |
100 | 60.65 |
The file with setOption moved ahead of generate_network |
50 | 30.33 |
The text PyBNF writes for the file as written (BNGLModel.model_text(), with k fitted and set to 0.5) |
50 | 30.33 |
The tail of the text PyBNF writes:
end model
setOption("MoleculesObservables","CountUnique")
begin actions
generate_network({overwrite=>1})
simulate({method=>"ode",t_end=>4,n_steps=>4,suffix=>"tc"})
end actions
Scope
- Editions. The example is an edition-1 model, with its own
simulate. In edition 2, a model withgenerate_networkthensetOptionand no other action passes the actions check (#969). - PEtab export. For that edition-2 model the export also writes the
setOptionahead ofbegin actions. The exported model agrees with the fit, and both disagree with the file. - Backends. I ran BNG2.pl on PyBNF's model text. The bngsim backends take their network from BNG2.pl run on the same text, so I expect the same there, but I did not run them.
- Options. Only
MoleculesObservableswas tested.
Where
BNGLModel.__init__ in pybnf/pset.py. The scanner keeps the setOption family (setOption, substanceUnits, version) in the model lines wherever they were written, and treats the other lines as actions. model_text() writes the model lines first and its own begin actions block, with generate_network, after them.
Found by the second review of #975. The behaviour is older than that PR.
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 25
- Merge trung bình
- 4 giờ 5 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lanl/PyBNF
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findingsĐang mởharness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mruangutai/harness#2455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stripthink leaves thinking text in place when the chat template opens the think tag in the promptCó thể đã có người làm @MaiAditya đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the runCó thể đã có người làm @BioGeek đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
instadeepai/winnow#312 ·