-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix SBML Rule handling logic #120
Conversation
RateRules were ignored so far...
if not with_values: | ||
return [p.getId() for p in sbml_model.getListOfParameters() | ||
if sbml_model.getAssignmentRuleByVariable(p.getId()) is None] | ||
if sbml_model.getRuleByVariable(p.getId()) is None] | ||
|
||
return {p.getId(): p.getValue() | ||
for p in sbml_model.getListOfParameters() | ||
if sbml_model.getAssignmentRuleByVariable(p.getId()) is None} | ||
if sbml_model.getRuleByVariable(p.getId()) is None} |
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.
Just some duplicated code, fine as is.
if not with_values: | |
return [p.getId() for p in sbml_model.getListOfParameters() | |
if sbml_model.getAssignmentRuleByVariable(p.getId()) is None] | |
if sbml_model.getRuleByVariable(p.getId()) is None] | |
return {p.getId(): p.getValue() | |
for p in sbml_model.getListOfParameters() | |
if sbml_model.getAssignmentRuleByVariable(p.getId()) is None} | |
if sbml_model.getRuleByVariable(p.getId()) is None} | |
parameters = { | |
p.getId(): p.getValue() | |
for p in sbml_model.getListOfParameters() | |
if sbml_model.getRuleByVariable(p.getId()) is None | |
} | |
if not with_values: | |
return list(parameters.keys()) | |
return parameters |
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.
You are right about the duplication, but I'd still keep it as is. For large models, this saves quite a couple of XML lookups.
RateRules were ignored so far...
Related to PEtab-dev/PEtab#539, PEtab-dev/PEtab#513