Conversation
valentinsulzer
left a comment
There was a problem hiding this comment.
Looks good :)
Still think we need a better solution for examples vs results, making sure the right things are tested but without taking forever. Maybe separate repository is the solution
| # Overwrite solver if given | ||
| if solver is not None: | ||
| self.solver = solver | ||
| else: |
There was a problem hiding this comment.
should this be else or just default behaviour?
There was a problem hiding this comment.
yeah probably should just be default.
I agree, I think a separate repository on pybamm-team with paper results and any undocumented (or poorly documented) examples would be good. Then make sure the examples that come as part of pybamm are actually really useful for learning how to use it/showcasing feature, rather than just a relatively random collection of scripts we make during development.
Codecov Report
@@ Coverage Diff @@
## master #645 +/- ##
=========================================
Coverage ? 98.49%
=========================================
Files ? 167
Lines ? 8177
Branches ? 0
=========================================
Hits ? 8054
Misses ? 123
Partials ? 0
Continue to review full report at Codecov.
|
Description
Allows the user to set
rtolandatolseparately. For the defaults I've selected 1e-3 for rtol and 1e-6 for atol. This is the same as other solvers (e.g. scipy.integrate or MATLABs ODE15s) and provides a pretty significant speedup vs 1e-8 for both. I've also reduced the default number of points in x, as again this speed things up quite a bit. Both of these result in a RMS voltage error of around 1e-4 compared with the previous defaults, but the default DFN now runs in around 3 seconds vs 23 seconds (on my computer at least).I think for most users, this kind of error is ok out of the box (the plots are indistinguishable), particularly if they are new users and just want to quickly run some examples. Users now have more control over both solver tolerances, so I think this is an ok compromise.
EDIT: I've decreased rtol to 1e-6 too. Seems like the thermal model and some other models didn't like rtol as low as 1e-3. Probably safer to have both set as 1e-6 so that the solvers don't immediately fall over when people add new physics.
Fixes #644
Type of change
Please delete options that are not relevant.
Key checklist:
$ flake8$ python run-tests.py --unit$ cd docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: