Port the BNGL parameter-expression evaluator to libpetab-python's BnglModel, then delete the staging copy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 25
- Forks
- 24
- Avg merge
- 2h 6m
- Merged PRs (30d)
- 95
Description
Context: #591 retired PyBNF's local BnglModel adapter once petab 0.9.0 shipped the native language: bngl loader (PEtab-dev/libpetab-python#508). That adapter was the only consumer of pybnf/petab/_bngl_expr.py, the BNGL parameter-expression evaluator from #666 (PR #673), whose module docstring says it is stdlib-only precisely so it can travel to libpetab-python.
The gap
petab's native BnglModel does not evaluate an expression-valued parameter:
get_parameter_valueraisesNotImplementedError("Evaluating a BNGL parameter expression requires BNG2.pl / network generation, which is out of scope for the introspection-only BnglModel").get_free_parameter_ids_with_valuescatches theValueErrorand silently skips the parameter.
That is exactly the pre-#666 behaviour, now on the petab-side validation path: a language: bngl problem whose model defines a parameter as an expression over other parameters (20.8% of declarations across the corpora on hand, per #673) loses that parameter from petab's parameter-table checks with nothing said.
This is not a regression introduced by #591. On petab 0.9.0 register_bngl() was already a no-op, so every 0.9.0 installation was already validating through the native class. But the #666 fix never reached the path it was written for.
What to do
Port the evaluator upstream: a PR to PEtab-dev/libpetab-python that gives BnglModel.get_parameter_value / get_free_parameter_ids_with_values the dependency-ordered, BNG2.pl-verified evaluation _bngl_expr implements (its semantics are pinned against BNG2.pl 2.9.3 in tests/test_petab_bngl_expr.py, which should travel too). Once a petab release carries it, delete pybnf/petab/_bngl_expr.py and its tests here and bump the petab floor.
Until then _bngl_expr.py stays in the tree as the staging copy, with no runtime consumer.
Contributor 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.
Research direction
Start with pybnf/petab/_bngl_expr.py and tests/test_petab_bngl_expr.py, then inspect libpetab-python's BnglModel methods named in the issue. Use the existing tests and BNG2.pl 2.9.3 semantics as the reference. Done means the evaluator is upstream, a release carries it, and this repository deletes the staging module and tests while raising its petab floor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100