Skip to content

Explain unresolved condition parameter references - #615

Open
ChenYueqi2024 wants to merge 2 commits into
PEtab-dev:mainfrom
ChenYueqi2024:fix/explain-unresolved-parameter-519
Open

ChenYueqi2024 wants to merge 2 commits into
PEtab-dev:mainfrom
ChenYueqi2024:fix/explain-unresolved-parameter-519

Conversation

@ChenYueqi2024

Copy link
Copy Markdown

Fixes #519.

When a condition override refers to an SBML parameter whose initial assignment cannot be reduced to a numeric value, the mapper may fall back to indexing a nonexistent parameter-table row. Check for that row first and raise a descriptive ValueError naming both the referenced parameter and the override target. Valid references still use the existing model or parameter-table resolution.

The regression test exercises the public mapping API with and without a parameter scale column. Both cases raise a raw KeyError before the fix and report the unresolved reference afterward.

Validation on Windows with Python 3.12: 44 mapping, lint, and calculation tests pass. All applicable pre-commit hooks and git diff --check pass.

Implemented and validated with OpenAI Codex assistance. Ready for review.

@ChenYueqi2024
ChenYueqi2024 requested a review from a team as a code owner November 19, 2026 12:30
Copilot AI balanced review requested due to automatic review settings November 19, 2026 12:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Condition-table override referencing a parameter with a non-numeric InitialAssignment crashes with an opaque KeyError

2 participants