-
-
Notifications
You must be signed in to change notification settings - Fork 710
[GSoC 2025] Saving and Loading Custom Models #5056
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5056 +/- ##
===========================================
- Coverage 98.86% 98.86% -0.01%
===========================================
Files 320 320
Lines 26568 26825 +257
===========================================
+ Hits 26266 26520 +254
- Misses 302 305 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
I’ve added an example notebook to demonstrate how the functionality works. I’d appreciate any suggestions for improvements or refinements you might have. |
agriyakhetarpal
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.
Thank you! We are getting closer. Could you please add a CHANGELOG entry and give this PR a more descriptive title, now that we know its scope?
I've left some suggestions related to the tests, that should be addressed (better error matching + better ways to organise saving/deleting files across tests)
Also, I had a question about the structure of the JSON. Right now, we have it as:
{
"schema_version": "1.0",
"pybamm_version": 25.6
"name": "MyModel",
"rhs": [], # something
"algebraic": [], # something
"initial_conditions": [], # something
# ...
}Would it be better organised if we were to have it as
{
"schema_version": "1.0",
"pybamm_version": 25.6
model: {
"name": "MyModel",
"rhs": [], # something
"algebraic": [], # something
"initial_conditions": [], # something
# ...
}
}i.e., have it nested, so that the schema version, the PyBaMM version, and the model are at one level and the model's attributes are one level deeper?
Saransh-cpp
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.
This looks good to me now! Should be ready to merge once Agriya's comment above is resolved.
|
I have addressed all the reviews. Please review and let me know if any further changes are needed. |
agriyakhetarpal
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.
Great work! I only have some nits and one functional change to request.
Saransh-cpp
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.
Should be ready to merge once @valentinsulzer approves it 🚀
|
Hmm, I'm unsure if the macOS-3.10 test failure is related. Just re-triggered it... |
Description
PR to serialise and deserialise custom models
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)
Important checks:
Please confirm the following before marking the PR as ready for review:
nox -s pre-commitnox -s testsnox -s doctests