pybamm-team / PyBaMM

Fast and flexible physics-based battery models in Python
https://www.pybamm.org/
BSD 3-Clause "New" or "Revised" License
1.08k stars 533 forks source link

Bug fix for cracking options #4221

Closed pipliggins closed 3 months ago

pipliggins commented 3 months ago

Description

Adds an OptionError if the option SEI on cracks is True but particle mechanics does not contain cracks. This issue only occurs if both options are set explicitly in the model's additional options - the user's particle mechanics option overrides the defaults which automatically set the mechanics to "swelling and cracking" if SEI on cracks is true.

Fixes #4119

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

Key checklist:

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.54%. Comparing base (e22d10c) to head (6df0f92). Report is 222 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #4221 +/- ## =========================================== - Coverage 99.55% 99.54% -0.02% =========================================== Files 288 288 Lines 21856 21878 +22 =========================================== + Hits 21759 21778 +19 - Misses 97 100 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kratman commented 3 months ago

@rtimms Does this cover everything you wanted in #4119? The code looks fine to me, but I have not tested it myself