Skip to content

Require compartments for concrete PySB species - #616

Open
ChenYueqi2024 wants to merge 2 commits into
PEtab-dev:mainfrom
ChenYueqi2024:fix/pysb-species-compartments-593
Open

ChenYueqi2024 wants to merge 2 commits into
PEtab-dev:mainfrom
ChenYueqi2024:fix/pysb-species-compartments-593

Conversation

@ChenYueqi2024

Copy link
Copy Markdown

Fixes #593.

PySBModel.is_state_variable accepted a fully specified set of sites even when the species lacked a compartment in a compartmental model. Use PySB's complex-level concreteness check. A complex can specify a shared compartment or a compartment for each monomer. The existing site multiplicity and bond checks still apply.

Regression tests cover omitted and explicit compartments for single monomers and complexes, including partially specified complexes and models without compartments. The two affected tests fail on the original implementation. All 37 PySB model and v1 lint tests pass on Windows with Python 3.12, as do the applicable pre-commit hooks.

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

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

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.

PySBModel.is_state_variable: require compartments for models with compartments

2 participants