PyBaMM
PyBaMM copied to clipboard
Automatically generate debugging file
When running long experiments, it can be hard to debug if the simulation fails a long way in.
If the simulation fails, automatically generate a debugging file with all the information necessary to recreate the failing simulation in just one cycle:
- model including options
- experiment
- parameter values
- discretization
- solver
- starting solution
Could be saved to pybamm.settings.debug_filename which defaults to debug.txt (and add debug.txt to the gitignore)
hey, @tinosulzer I would l like to work on this issue.😀
This PR might be relevant
The first step for this is to have a nice __repr__ for the various objects, which shows which arguments and kwargs were passed in, e.g. pybamm.lithium_ion.DFN(options={"thermal": "x-full"}) (not the whole options dict). scikit-learn does this pretty nicely, see https://github.com/scikit-learn/scikit-learn/blob/f71c0313142c4e5f2f35a0021c36075cf8dba611/sklearn/utils/_pprint.py
This is definitely not a simple first issue! But it doesn't require super in-depth knowledge of the code base at least
Is it still opened?