PyBaMM
PyBaMM copied to clipboard
Automate source wrap
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes #1410
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:
- No style issues:
nox -s pre-commit - All tests pass:
nox -s tests - The documentation builds:
nox -s doctests - Code is commented for hard-to-understand areas
- Tests added that prove fix is effective or that feature works
Thanks taking this on! For it to work properly we need to wrap all the terms that aren’t a spatial operator in source, eg see https://github.com/pybamm-team/PyBaMM/blob/9415db5037ca5978a91723ff9a64c3c44d85e0e0/src/pybamm/models/submodels/thermal/pouch_cell/pouch_cell_2D_current_collectors.py#L89
I’m not sure this is what your solution does. Can you add a test to show that pybamm.laplacian(a) + b gets turned into pybamm.laplacian(a) + pybamm.source(b) to show this works in the simplest case? Then we can go from there.
Okay I've made a huge mistake clearly, will try to figure out if there's a way to handle all these cases by just modifying the wrap_source function that I've made. Have my final exams going on, will continue my attempt at solving this issue in a few weeks
Hi @ArivoliR, If you are still on it - feel free to let us know in case you need help.
I spent a while on this, could not get far. Will be closing this draft PR. Thanks a lot for your guidance!