Skip to content

Issue 697 abs tol vec#700

Merged
Scottmar93 merged 8 commits intomasterfrom
issue-697-abs-tol-vec
Nov 4, 2019
Merged

Issue 697 abs tol vec#700
Scottmar93 merged 8 commits intomasterfrom
issue-697-abs-tol-vec

Conversation

@Scottmar93
Copy link
Contributor

@Scottmar93 Scottmar93 commented Oct 31, 2019

Description

Added setting tols by variable to the KLU solver.

Fixes #697

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

@codecov
Copy link

codecov bot commented Oct 31, 2019

Codecov Report

Merging #700 into master will decrease coverage by 0.09%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #700     +/-   ##
=========================================
- Coverage   98.26%   98.17%   -0.1%     
=========================================
  Files         176      176             
  Lines        9106     9133     +27     
=========================================
+ Hits         8948     8966     +18     
- Misses        158      167      +9
Impacted Files Coverage Δ
pybamm/solvers/idaklu_solver.py 82.29% <66.66%> (-6.12%) ⬇️

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 e8d2b41...6a759f1. Read the comment docs.

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.

Cheers @Scottmar93 , looks good, other than the coverage 😉

slices = state_vec.y_slices[0]
self._atol[slices] = tol

def _check_atol_type(self, size):
Copy link
Member

Choose a reason for hiding this comment

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

make it clear in the name that this function also changes self._atol. In fact this could all go in @atol.setter, either for KLU or BaseSolver

@Scottmar93 Scottmar93 merged commit cb106df into master Nov 4, 2019
@valentinsulzer valentinsulzer deleted the issue-697-abs-tol-vec branch December 7, 2019 22:16
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.

Accept vector of abs tol into KLU

2 participants