pybamm-team / PyBaMM

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

move secondary broadcast outside of gradient #4190

Closed valentinsulzer closed 2 weeks ago

valentinsulzer commented 2 weeks ago

Description

This fixes the edge case for #2837 / removes the need to use x-average

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 2 weeks ago

Codecov Report

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

Project coverage is 99.58%. Comparing base (20046d4) to head (5388515). Report is 2 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #4190 +/- ## ======================================== Coverage 99.58% 99.58% ======================================== Files 288 288 Lines 21797 21799 +2 ======================================== + Hits 21706 21708 +2 Misses 91 91 ```

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

valentinsulzer commented 2 weeks ago

I haven't followed that bug, what is it?

brosaplanella commented 2 weeks ago

I believe it was an issue with pybamm.grad(2*c). Having a 1 worked but having a 2 crashed it. I think Rob knows more about it.