Realign 'count' increment#2986
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2986 +/- ##
=========================================
Coverage 99.71% 99.71%
=========================================
Files 273 245 -28
Lines 19032 18705 -327
=========================================
- Hits 18977 18651 -326
+ Misses 55 54 -1
☔ View full report in Codecov by Sentry. |
rtimms
left a comment
There was a problem hiding this comment.
thanks, looks good! the failing notebook (examples/notebooks/parameterization/parameter-values.ipynb) looks unrelated to your changes - does it run locally for you?
pybamm/solvers/casadi_solver.py
Outdated
| if first_ts_solved: | ||
| dt_max = dt | ||
| if count >= self.max_step_decrease_count: | ||
| if count - 1 >= self.max_step_decrease_count: |
There was a problem hiding this comment.
would just doing count > self.max_step_decrease_count be simpler to read?
There was a problem hiding this comment.
Just doing count > self.max_step_decrease_count would be simpler to read, I have changed it.
The "parameter-values" notebook runs locally for me, but I noticed that there was a different value assigned for a parameter (b) in the markdown cell than in the code cell of the "Solving a model" section and assigned it to the value of the code cell.
The example fails because in one of the lines it uses a |
|
The failing notebook is unrelated to this PR and will be fixed as part of #2957 |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
rtimms
left a comment
There was a problem hiding this comment.
thanks @julian-evers looks good!
|
@all-contributors please add @julian-evers for code |
|
I've put up a pull request to add @julian-evers! 🎉 |
Description
Increment 'count' adjacent to the 'dt' change to avoid an off-by-one error of 'max_count'.
Fixes #2964
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:
$ pre-commit run(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all$ python run-tests.py --doctestYou can run unit and doctests together at once, using
$ python run-tests.py --quick.Further checks: