Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pattern matching with compartments #570

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

FFroehlich
Copy link
Contributor

Enable RulePatternMatcher and SpeciesPatternMatcher for models with compartments. Support was already there, just removed NotImplementedError - this is validated by including move_connected, which contains species with compartments, in the test_all_species generated test.

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.43%. Comparing base (6d850c2) to head (07c25b0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #570      +/-   ##
==========================================
+ Coverage   78.28%   78.43%   +0.15%     
==========================================
  Files         106      106              
  Lines       11253    11301      +48     
==========================================
+ Hits         8809     8864      +55     
+ Misses       2444     2437       -7     
Flag Coverage Δ
os-macos-latest 78.43% <100.00%> (+0.15%) ⬆️
os-ubuntu-latest 78.42% <100.00%> (+0.15%) ⬆️
os-windows-latest 2.76% <1.51%> (-0.02%) ⬇️
python-3.10 78.43% <100.00%> (+0.15%) ⬆️
python-3.11 78.43% <100.00%> (+0.15%) ⬆️
python-3.12 78.43% <100.00%> (+0.15%) ⬆️
python-3.8 78.42% <100.00%> (+0.15%) ⬆️
python-3.9 78.42% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FFroehlich FFroehlich changed the title Fix pattern matching Enable pattern matching with compartments May 11, 2023
Copy link
Member

@alubbock alubbock left a comment

Choose a reason for hiding this comment

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

LGTM overall, though it's been a while since I worked with compartments. Ideally it'd be good to see test coverage for the two lines highlighted by codecov - particularly pysb/core.py line 956.

@FFroehlich
Copy link
Contributor Author

FFroehlich commented Feb 15, 2024

LGTM overall, though it's been a while since I worked with compartments. Ideally it'd be good to see test coverage for the two lines highlighted by codecov - particularly pysb/core.py line 956.

Ah! turns out adding the edges in line 956 is actually not even necessary, simply adding the species compartment node to the graph is sufficient. Removed the respective lines, added a test for the value error and simplified the code a bit further.

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.

None yet

2 participants