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
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 25
- Forks
- 25
- Merge medio
- 4 h 5 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/PyBNF
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug silent-incorrectness
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
software-mansion-labs/Diplomat#20 ·
Los mantenedores suelen responder en 1 día
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPosiblemente ocupada @lijy91 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
libnativeapi/nativeapi#53 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
View Counts discarded due to field name mismatchPosiblemente ocupada @rsiva0400 la tomó hoy. Abiertosite-bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Model version publishes the new UK firm entity as a personPosiblemente ocupada @vahid-ahmadi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/policyengine.py#764 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
spcl/HPCAgent-Bench#264 ·
Los mantenedores suelen responder en 1 día