Skip to content

Port the BNGL parameter-expression evaluator to libpetab-python's BnglModel, then delete the staging copy #681

Description

@wshlavacek

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_value raises NotImplementedError ("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_values catches the ValueError and 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions