-
-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
# also reduce maximum step size for future global steps, | ||
# but skip them in the beginning | ||
# sometimes, for the first integrator smaller timesteps are | ||
# needed, but this won't affect the global timesteps. The | ||
# global timestep will only be reduced after the first timestep. | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would just doing count > self.max_step_decrease_count
be simpler to read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 --doctest
You can run unit and doctests together at once, using
$ python run-tests.py --quick
.Further checks: