A setOption line ending in a stray backslash runs in BNG2.pl, but PyBNF refuses it (edition 2) or breaks its simulations (edition 1), and neither message mentions the backslash
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Start with BNGLModel.__init__ in pybnf/pset.py, where the issue says continued lines are scanned and joined. Reproduce the blank-line and comment-line cases, then add regression coverage for both. Done means every edition handles these files consistently with BNG2.pl, and any refusal identifies the stray backslash.
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 complete setOption(...) line that ends in a stray \, followed by a blank line or a comment line:
end model
setOption("MoleculesObservables","CountUnique")\
begin actions
generate_network({overwrite=>1})
end actions
What happens. BNG2.pl drops the \, ends the statement at the blank or comment line, and applies the option, with no warning. PyBNF joins the line to the next line that is neither blank nor a comment, here begin actions, and then fails in one of two ways:
-
Edition 2. The job is refused at load. The message shows a statement the user never wrote, and gives a reason that is not the cause:
carries BNGL actions that are not network-definition directives -- line 18: setOption("MoleculesObservables","CountUnique")begin actions. [...] A directive must be the only statement on its line, with nothing after its call but a comment: BNG2.pl runs the rest of the line as code (line 18).
-
Edition 1. The model loads. The model text PyBNF writes then holds the user's
begin actionsfollowed by PyBNF's own, and BNG2.pl aborts on it:ABORT: begin block before end of previous block actions.
Consequence. No wrong result: both failures are loud. But a file that BNG2.pl runs correctly is blocked, and neither message mentions the \, so the user looks in the wrong place.
What should happen. The simplest fix is to refuse the file at load in every edition, with a message that names the \. For example: "line 18 ends in \, but the next line is blank (or a comment). Delete the \." That matches the end-of-file refusal added in #975. The alternative is to read the file as BNG2.pl does and end the statement at the blank or comment line.
What I ran
The dimer model from #981, with the tail above plus a simulate line inside the block so that BNG2.pl writes output. BNG2.pl 2.9.3 on that file gives D = 50 at t = 0, which is the CountUnique count, with no warning. The result is the same when the line after the \ is a comment instead of a blank line.
Edition 2: BNGLModel(...).require_no_protocol_actions() on the file without the simulate line raises the message quoted above, for both the blank-line and the comment-line form.
Edition 1: BNGLModel.model_text() for the file with the simulate line ends with
end model
setOption("MoleculesObservables","CountUnique")\
begin actions
begin actions
generate_network({overwrite=>1})
simulate({method=>"ode",t_end=>4,n_steps=>4,suffix=>"tc"})
end actions
and BNG2.pl aborts on that text. I did not run a full edition-1 fit. I expect every simulation in it to fail, with the abort in the simulation log.
Where
BNGLModel.__init__ in pybnf/pset.py. While a \ continuation is pending, the scanner skips blank and comment lines and joins the statement to the next line of code. BNG2.pl's reader ends the statement at a blank or comment-only line.
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 ·