Skip to content

v2: reject reserved keywords as identifiers #594

Description

@dweindl

The PEtab v2 spec reserves the following keywords (case-insensitive), which must not be used as identifiers (Reserved keywords):

  • true, false
  • inf
  • time
  • nan
  • PEtab math function names

libpetab currently does not check this. _valid_petab_id (petab/v2/core.py) only checks the identifier pattern via petab.v1.lint.is_valid_identifier, so, e.g., a parameter, observable, or condition target with ID time or Exp is accepted. Some of these cases are currently caught only incidentally (e.g., with #588, a parameter time is reported as extraneous), others not at all.

To be decided where to check this:

  • Pydantic validation in _valid_petab_id / _valid_petab_id_or_none: catches it on construction for all PEtab tables. is_valid_identifier is shared with v1, whose spec has no such list, so this would need a v2-specific check.
  • A ValidationTask in petab/v2/lint.py: reports all occurrences at once instead of failing on the first one, and can also cover model entity IDs (e.g., an SBML parameter time), which Pydantic validation of the PEtab tables can't.

Possibly both: Pydantic for the PEtab tables, a lint task for the model.

🤖 Generated with Claude Code

Activity

  1. added
    v2Affects petab.v2 / PEtab 2.x
    specRequires or follows a change/clarification of the PEtab specification
    on Nov 16, 2026
  2. added theissue type on Nov 16, 2026
  3. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

specRequires or follows a change/clarification of the PEtab specificationv2Affects petab.v2 / PEtab 2.xvalidation

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions