-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implement GITT example #249
Implement GITT example #249
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #249 +/- ##
===========================================
+ Coverage 95.70% 95.80% +0.10%
===========================================
Files 38 39 +1
Lines 2048 2097 +49
===========================================
+ Hits 1960 2009 +49
Misses 88 88 ☔ View full report in Codecov by Sentry. |
Great work @brosaplanella and @muhammedsogut! I'm happy to review when you're ready. |
Will fix the coverage and try to get the optimiser to converge, but might need help with that. Will get in touch! |
tests/unit/test_GITT.py
Outdated
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.
I am not familiar with pytest so created a separate file, but it might be good to structure the tests in subfolders in the same fashion as the pybop directory.
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 for this addition @brosaplanella - overall it looks great!
I've left a few comments to look at, the biggest being the addition of the GITT class. I think in this situation it can be summarised into an example with the fitting class and either diffusion parameter. Happy to chat further about this.
Brady's suggestions Co-authored-by: Brady Planden <[email protected]>
Nice work @brosaplanella! I've added a couple of comments to Brady's review. In short, I think this is a great structure to build upon. I can imagine the GITT problem class being extended in a few useful ways in future, so I would keep it separate from the example script. For example, we could add processing of multiple pulses and more user guidance/warnings relating to different models. The one change I would like to see is for the |
Here's the example implementation using the |
I'm conscious that this PR has had a blocker on the addition of a |
@BradyPlanden I think it is reasonable to add GITT as a Problem subclass in this PR - providing user guidance on the GITT fitting procedure is within scope of the PyBOP aims and creating the class provides a place to store and develop this guidance. |
Following up on our discussion from yesterday, we agreed to move the GITT class into an example script (or notebook). In addition adding references pb-param where applicable in the docstrings of these classes/methods. |
This is ready now. Unfortunately the codecov failed, so I can't see the coverage (I suspect tests are missing but not sure where). Will try to debug locally. EDIT: tried running the coverage locally and I get a test failing, so don't get a report unfortunately. Codecov says my branch is covered (https://app.codecov.io/gh/pybop-team/PyBOP/tree/brosaplanella%2FPyBOP%3Aissue-223-GITT/pybop%2Fmodels%2Flithium_ion), so if we can't get the report to work on this PR we can always merge and I am happy fixing the coverage as a separate PR if there are any issues. |
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.
Nice additions, thanks @brosaplanella !
I retriggered the coverage test and it seems to have worked this time. Let's see if it continues to fail sporadically, if so I'll open an issue and we'll sort it out. Thanks for updating so quickly, if you can get the coverage up that would be great. I think you should be able to add the additional tests to the |
About the default parameters for the Weppner&Huggins model, the main difference is that it uses a linearised OCP. I think the choice boils down to:
1 gives users more control, but would require me tinkering with the default parameters, 2 would work with any of the existing PyBaMM parameter sets. For now, it might be better to go with 1, and we can always support 2 in the future. Thoughts? |
Happy to go with your decision on this @brosaplanella - my thoughts would be that (2) would be the desirable default in future, with the option to override the computed values via (1). |
I totally agree! I would like to implement some of the more advanced models for GITT, which I think they will give a better perspective on how to proceed, and we can address them as a future PR. |
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.
Excellent - nice one @brosaplanella. LGTM!
@all-contributors please add @muhammedsogut for code. |
I've put up a pull request to add @muhammedsogut! 🎉 |
Description
Implement the GITT FittingProblem. I had to add a custom model for GITT and include a couple of hacks for the models to work for half-cells and I refactored the problems into a folder as there were now 4 of them (happy to revert that if you prefer).
The example is not working because it gets stuck in optimising, but produces an outcome, so I thought this would be a good time to open a PR and have some discussions.
Note this PR reuses a lot of code written by @muhammedsogut for pybamm-param
Issue reference
Fixes #223
Review
Before you mark your PR as ready for review, please ensure that you've considered the following:
Type of change
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ nox -s tests
$ nox -s docs
You can run integration tests, unit tests, and doctests together at once, using
$ nox -s quick
.Further checks:
Thank you for contributing to our project! Your efforts help us to deliver great software.