The PEtab importer ignores a problem.yaml extension marked `required: true`, where the PEtab v2 spec says a tool that does not support it must reject the problem
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start in pybnf/petab/import_.py at read_problem_yaml (around lines 1429-1430, 1437, 1527, and 1579), then follow import_job around lines 244-245. Reproduce the with_ext and no_ext imports from the issue and compare their output. Done means a required unsupported extension is rejected with its name, while an extension marked required: false is ignored with a note.
Written by the indexing model from the issue text.
Description
A PEtab v2 problem.yaml can list extensions under an extensions: key. An extension marked required: true is one that "changes the mathematical interpretation" of the problem. For example, the SciML extension replaces part of the model with a neural network. The spec says: "Toolboxes must reject PEtab problems that use extensions with required: true that they do not support." PyBNF supports no extensions. Even so, its importer skips the whole extensions: block without a message and writes the same job it writes when the block is deleted. The user then fits a different problem from the one the file declares and is never told. PyBNF should refuse such a problem and name the extension.
Example
Take any PEtab v2 problem that PyBNF imports. For example, use a BNGL model m.bngl with 0 -> A() v3 and A() -> 0 k, one observable obsA = A, and a parameters table that estimates k. Append this to its problem.yaml:
extensions:
my_ext:
version: 1.0.0
required: true
Then import it twice, once with the block and once without:
from pybnf.petab import import_job
import_job('with_ext/problem.yaml', 'imp_ext')
import_job('no_ext/problem.yaml', 'imp_noext')
Both calls return without printing anything, and diff -r imp_ext imp_noext finds no difference. A SciML-shaped block (sciml: with version, required: true, neural_networks:, hybridization_files: and array_files:) also gives output identical to the problem without it.
What PyBNF should do comes from the spec's Extensions section (petab.readthedocs.io, v2 data format), quoted above. The problem YAML schema defines required as whether "the extension is required for the mathematical interpretation of the problem". libpetab is a validator, not a simulator, so the rule does not bind it, but it does report the block. petab.v2.Problem.from_yaml records extensions: {'my_ext': ExtensionConfig(version='1.0.0', required=True)}, and lint_problem warns: The given problem uses the following extensions for which validation is not yet implemented: my_ext.
Why
read_problem_yaml (pybnf/petab/import_.py:1437) parses the file by hand. Since #902 it refuses any top-level key that the PEtab v2 schema does not allow. It accepts extensions as one of the allowed keys, with the comment "id and extensions carry nothing the importer reads" (import_.py:1429-1430). The key sets in_other (import_.py:1527), and every indented line beneath it is then skipped (import_.py:1579). import_job (import_.py:244-245) goes straight from this reader to the model-language check, so nothing records or checks an extension or its required flag.
Possible fix
In read_problem_yaml, record each entry under extensions: with its required value. In import_job, refuse any extension whose required is not literally false, naming the extension and quoting the spec's rule. The spec lets a tool ignore an extension with required: false, so for those a one-line note that PyBNF ignores it is enough.
Related: #902 (which rewrote this reader)
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