-
Notifications
You must be signed in to change notification settings - Fork 228
Feature/implement groups #754
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
Feature/implement groups #754
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #754 +/- ##
==========================================
- Coverage 82.87% 82.54% -0.34%
==========================================
Files 40 41 +1
Lines 3883 3981 +98
Branches 885 911 +26
==========================================
+ Hits 3218 3286 +68
- Misses 463 489 +26
- Partials 202 206 +4
Continue to review full report at Codecov.
|
|
Ok, I reran update_pickles.py so the files represent their true state. Also did it to retrigger the travis build; looks like the python 2.7 build timed out without any error. edit: leaving mini.json as is makes the travis build fail, but tests were fine before. |
Midnighter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few changes to the class interface, for example, no assignment to .members only via .add_members. The only problem right now is that cobra.Model has no add_genes methods. We need to fix that first. Also, the other tests will pass once the schema is updated via the other open PR.
…than local tox/pytest
… to fill with "1" rather than the int 1 when running update_pickles.py.
…manually edited version).
b0cc984 to
2558642
Compare
|
Hi @gregmedlock, thanks again for your work here.Your code has been merged as part of #685. I have some code locally that will extend the JSON schema with groups. So that still needs to be done but this code is finally in devel. I'm closing the PR because your code was merged locally. |
Implements the
groupclass and theModel.groupsattribute for better compliance with the SBML FBC package, fixes #543.Some key implementation choices:
Grouphas amembersattribute, which is a set of reactions, metabolites, and/or genes.Groupthat is not associated with a model can be generated in isolation and associated with cobrapy objects; upon addition of theGroupto the model, all cobrapy objects associated with theGroupare also added.Groupis removed from a model, no modifications are made to cobrapy objects that were previously members of the group.model.get_associated_groups()is used to dynamically look up group membership. This PR does not have a model-based helper function for retrieving group information en masse (e.g. group membership info for all reactions, metabolites and genes with a single function)Models needed to be repickled for tests to pass; one interesting artifact is a "version" tag in mini.json that is now being regenerated with a string in the corresponding field as "1" instead of the int (1) that is compliant with the jsonschema. I'm not sure what the source of this is, since it seems like it's been a while since the models were repickled in a PR. So, here I just manually corrected the issue in mini.json (changing "1" to 1).
I think I will add documentation for groups in a separate PR; would it make the most sense to add a section in "building a model" and "reading and writing a model"?
Code review and comments for improvement are much appreciated; I tried to keep things consistent with the rest of the codebase where possible. @matthiaskoenig please let me know if I missed some major functionality that would make the libsbml integration smoother!