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

Created unit tests for all previously defined MIRA operations. Added new MIRA operations and most of their unit tests as well. Fixed several bugsa as well. #238

Merged
merged 11 commits into from
Sep 7, 2023

Conversation

nanglo123
Copy link
Contributor

New MIRA Operations in mira/modeling/askenet/ops.py

  • replace_rate_law_mathml
  • add_parameter
    • Currently, we only add parameters that are present in rate laws. Thus newly added parameters using this method are not present in the output amr file. @bgyori will decide how to handle adding parameters not present in any rate laws.
  • remove_X where X is an observable or parameter
    • If X is an observable, we simply just pop the observable object from the dict of observables
    • If X is a parameter, we remove the parameter from the list of parameters in the output amr file and replace every instance of the replaced parameter with the replacement value
  • add_transition
    • Currently, new states and parameters present in the rate law passed in when adding a transition are not added to the list of states and parameters repsectively of the output amr file
  • add_observable
  • replace_x_expression
    • Added 2 versions of the method in which we either pass in a Sympy object or xml string (mathml object) representing the rate law

Unit tests for MIRA operations in tests/test_modeling/test_askenet.py

  • Added passing unit tests for all previously defined MIRA operations. Added passing unit tests for all newly added operations except for add_parameter. Currently, the unit test for add_transition doesn't test for the presence of newly added states and parameters.

Bug Fixes

  • Fixed a bug in commit e9cb3dc where changed parameters after calling replace_parameter_id were not showing in output amr['semantics']['ode']['parameters']

  • Fixed a bug in commit 0ae9ed0 and commit a1e6381 where observables in the output amr had identical values for their name and id field (template model-> amr). Also fixed an issue where template models constructed from an amr file (amr -> template model) used a observables['id'] for the name and display_name of a concept. Now the name field will take the display_name attribute associated with a concept and id will take the id attribute associated with a oncept.

…or test_replace_rate_law_sympy to test both output amr expression and expression_mathml
…_expression(xml_str) rather than sympy.repr(str) to method
…ailure more apparent and fixed bug where changed parameter ids not showing in parameter list of new_amr
…eplacing observable id to accept a display name argument
…e objects have a non None value for their display name attribute
…s and parameters are not showing in the output amr) and its accompanying unit test
@bgyori bgyori merged commit 7cafc2c into gyorilab:modeling_api Sep 7, 2023
0 of 2 checks passed
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.

2 participants