-
Couldn't load subscription status.
- Fork 30
Support for PEtab SciML in jax #2614
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2614 +/- ##
==========================================
+ Coverage 76.48% 77.25% +0.76%
==========================================
Files 308 309 +1
Lines 19540 19804 +264
Branches 1499 1500 +1
==========================================
+ Hits 14945 15299 +354
+ Misses 4582 4492 -90
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PEtab SciML test suite - test_net and test_ude cases
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Thanks. Just some initial feedback, for now. Will try to finish later this week.
Documentation is a bit sparse. It would be great to have docstrings in all functions/classes/modules.
Please also add an item to CHANGELOG.md.
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.
Please add to python_examples.rst
| ignore:Conservation laws for non-constant species in models with RateRules are currently not supported and will be turned off.:UserWarning | ||
| ignore:Conservation laws for non-constant species in models with Species-AssignmentRules are currently not supported and will be turned off.:UserWarning | ||
| ignore:Conservation laws for non-constant species in combination with parameterized stoichiometric coefficients are not currently supported and will be turned off.:UserWarning | ||
| ignore:PEtab v2.0.0 mapping tables are only partially supported:UserWarning |
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.
Still relevant? I couldn't see that warning anywhere.
| allow_reinit_fixpar_initcond: bool | None = True, | ||
| generate_sensitivity_code: bool | None = True, | ||
| model_name: str | None = "model", | ||
| hybridisation: dict | None = 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.
Please document
| Parses the hybridisation information and updates the model accordingly | ||
| :param hybridization: | ||
| hybridization information |
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.
This could be more informative 😅
Is this documented in petab-sciml? Add reference?
| } | ||
| if len(outputs.keys()) != len(net["output_vars"]): | ||
| raise ValueError( | ||
| f"Could not find all output variables for neural network {net_id}" |
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.
Include the missing ones in the message?
| True | ||
| if p | ||
| in set(self._parameter_mappings[sc].map_sim_var.keys()) | ||
| else False |
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.
| True | |
| if p | |
| in set(self._parameter_mappings[sc].map_sim_var.keys()) | |
| else False | |
| p in set(self._parameter_mappings[sc].map_sim_var.keys()) |
| } | ||
| for net_id, net_config in config["neural_nets"].items() | ||
| } | ||
| if not jax or petab_problem.model.type_id == MODEL_TYPE_PYSB: |
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.
| if not jax or petab_problem.model.type_id == MODEL_TYPE_PYSB: | |
| if not jax or petab_problem.model.type_id != MODEL_TYPE_SBML: |
More future-proof.
|
|
||
|
|
||
| # for backwards compatibility | ||
| import_model = import_model_sbml |
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.
| # for backwards compatibility | |
| import_model = import_model_sbml |
This has been removed in main, I guess it's an unintentional merge leftover.
| self.sbml_doc.validateSBML | ||
| )() | ||
| _check_lib_sbml_errors(self.sbml_doc, self.show_sbml_warnings) | ||
| # _check_lib_sbml_errors(self.sbml_doc, self.show_sbml_warnings) |
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.
Why?
| # the SBMLError log in the sbml document. Thus, it is sufficient to | ||
| # check the error log just once after all conversion/validation calls. | ||
| _check_lib_sbml_errors(self.sbml_doc, self.show_sbml_warnings) | ||
| # _check_lib_sbml_errors(self.sbml_doc, self.show_sbml_warnings) |
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.
Why?
|




CI
neural nets
004-008,021,022,046-048,050)amici core
tests