A condition that sets the same target twice (perturbations: L = 2, L = 7) is accepted, and the last value silently wins
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
Research direction
Start with the condition grammar in pybnf/parse.py around lines 604–635 and the condition loading in config.py. Trace how repeated perturbation targets are applied, then inspect the PEtab export path. Done means duplicate targets are rejected with the condition and target named, with coverage for both backends and the export.
Written by the indexing model from the issue text.
Description
A condition: line may list the same parameter more than once, for example condition: c, perturbations: L = 2, L = 7. PyBNF accepts it without a message and applies the values in order, so the experiment runs at L = 7 on both BNG2.pl and bngsim. A line like this is almost always a mistake, such as a copy-paste slip or two conditions merged by hand. Nothing says which value was meant, so PyBNF should refuse it at load and name the condition and the target. The PEtab export also writes both rows (cond_c L 2 and cond_c L 7) into conditions.tsv, and libpetab's lint accepts them, so the ambiguity passes into the exported problem too.
Example
m.bngl (A is made at rate L and decays at rate k·A, starting from 0):
begin model
begin parameters
k 1
L 1
end parameters
begin molecule types
A()
end molecule types
begin seed species
A() 0
end seed species
begin observables
Molecules A_tot A()
end observables
begin reaction rules
0 -> A() L
A() -> 0 k
end reaction rules
end model
e1.exp holds 2(1 − e^(−t)) at t = 0, 0.5, 1, 2, 4, which is the model at L = 2 and k = 1.
edition = 2
job_type = de
objective = sos
model: m.bngl
condition: c, perturbations: L = 2, L = 7
experiment: e1, condition: c, data: e1.exp
uniform_var = k 0.99999 1.00001
The narrow box on k makes every evaluation use k ≈ 1:
| backend | objective |
|---|---|
bngl_backend = bngsim |
28.3212 |
bngl_backend = bionetgen |
28.3212 |
| closed form at L = 7 | 28.3218 |
| closed form at L = 2 | 0 |
The closed forms are 0.5·Σ(L(1 − e^(−t)) − y)². Both backends use L = 7. Neither the console nor the log mentions the duplicate. export_job writes both rows for cond_c, and petab.v2.lint.lint_problem returns no issues.
The same line can come out of a PEtab import. On main, two PEtab condition ids that map to one PyBNF name (cond_a and a) are merged into a single condition: line with both targets (see #950). Open PR #947 refuses that merge.
Why
The condition: grammar (pybnf/parse.py around 604–635) accepts any list of perturbations, and config.py's condition loading turns each one into a mutation applied in order, with no check for a repeated target. The exporter writes one row per perturbation.
Possible fix
When the conf loads, refuse a condition that names the same target more than once, whatever the operators (L = 2, L = 7, and also L = 2, L * 3). The error should name the condition and the target. Add a test on both backends and one for the export.
Found while fixing the PEtab issues #892–#908 (2026-09-25); reproduced on main at cd2be675.
- Dominant language
- Python
- Stars
- 25
- Forks
- 25
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/PyBNF
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day