-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Serialisation of models #3397
Merged
Merged
Serialisation of models #3397
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
a4fedae
Draft a serialisation method
pipliggins 70b765d
Move deserialisation functions to Symbol classes
pipliggins 4ea8108
Create Serialise class
pipliggins 6694cb1
Serialised models can be plotted.
pipliggins 7fadee3
Add unit tests for to_json()
pipliggins 25cb002
Allow saving of geometry where symbols are dict keys
pipliggins efa7888
Add _from_json tests for symbols without children
pipliggins fbc8f6f
(wip) testing: add draft de/serialisation tests
pipliggins 4745484
(wip) tests: add _from_json tests with children
pipliggins 80fc250
testing: add unit tests for Serialise() functions
pipliggins ac928ab
testing: save/load model tests
pipliggins 9e323d9
testing: Add integration tests
pipliggins 2934df4
Add docs for serialisation
pipliggins 66d8045
Increase test coverage
pipliggins d5dd21d
Fix minor style issues
pipliggins 6d63732
Remove accidental SpatialOperator.diff() addition
pipliggins 0cc0aee
Edits after review
pipliggins 2a72cf8
Merge branch 'develop' into serialisation
pipliggins 616c0d8
Serialisation: fix integration tests
pipliggins 8e32718
Reduce test tolerance of sei_asymmetric_ec_reaction_limited
pipliggins 1e16b92
fix: change serialisation test accuracy
pipliggins 62a46ef
Additional tests for codecov
pipliggins 5211233
More coverage updates to serialise and 1D meshes
pipliggins a1ac313
Merge branch 'develop' into serialisation
pipliggins afa187e
Update CHANGELOG
pipliggins b745317
style: pre-commit fixes
pre-commit-ci[bot] 3fec37e
Add error message for experiment
pipliggins 92e7c90
Update notebook to suggest build() not solve()
pipliggins 95935a0
Merge branch 'develop' into serialisation
pipliggins 04f4230
Add outputs to example notebook
pipliggins ca63509
style: pre-commit fixes
pre-commit-ci[bot] df35b91
Fix ruff errors
pipliggins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Serialise | ||
========= | ||
|
||
.. autoclass:: pybamm.expression_tree.operations.serialise.Serialise | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
376 changes: 376 additions & 0 deletions
376
docs/source/examples/notebooks/models/saving_models.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Given that PyBaMM supports Python 3.8+, each file using the newer type hints mus import -
at the top to ensure backward compatibility. This can also be automated using the
isort
rules inruff
.