Skip to content
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

Issue 710 atol klu #721

Merged
merged 4 commits into from
Nov 12, 2019
Merged

Issue 710 atol klu #721

merged 4 commits into from
Nov 12, 2019

Conversation

Scottmar93
Copy link
Contributor

Description

The bug was appearing because setting the atol vector is attached to the solver. If you then call the solver on a different model with a different number of states, it will break.

Fix: the atol vector is now attached to the model (via model.atol) and not the solver. If model.atol exists then the solver will use it otherwise it will use self.atol (the scalar value). Users can still set and change the scalar value for a solver and reuse that on different models but vector atols (which are model and dicretization specific) are attached to the model.

Fixes #710

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.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #721 into master will increase coverage by <.01%.
The diff coverage is 80.95%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #721      +/-   ##
=========================================
+ Coverage    98.1%   98.1%   +<.01%     
=========================================
  Files         175     175              
  Lines        9190    9196       +6     
=========================================
+ Hits         9016    9022       +6     
  Misses        174     174
Impacted Files Coverage Δ
pybamm/solvers/dae_solver.py 99.45% <ø> (ø) ⬆️
pybamm/solvers/scikits_dae_solver.py 97.72% <ø> (ø) ⬆️
pybamm/solvers/idaklu_solver.py 83.33% <80.95%> (+1.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a2ec0a...68d93e3. Read the comment docs.

@Scottmar93 Scottmar93 merged commit 7f7254c into master Nov 12, 2019
@valentinsulzer valentinsulzer deleted the issue-710-atol-KLU branch December 7, 2019 22:15
rtimms added a commit that referenced this pull request Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with atol in KLU
2 participants