Skip to content

Issue 830 algebraic - #868

Merged
valentinsulzer merged 15 commits into
developfrom
issue-830-algebraic
Mar 9, 2020
Merged

valentinsulzer merged 15 commits into
developfrom
issue-830-algebraic

Conversation

@valentinsulzer

Copy link
Copy Markdown
Member

Description

Reformat algebraic solver to be more in line with the other solvers, and add casadi algebraic solver.
We could call the algebraic solvers to initialize the dae models, would reduce code duplication, but might be a little bit confusing?

Fixes #830

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.

  • 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

codecov Bot commented Mar 1, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #868 into develop will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #868      +/-   ##
===========================================
+ Coverage    97.70%   97.75%   +0.04%     
===========================================
  Files          201      202       +1     
  Lines        10433    10459      +26     
===========================================
+ Hits         10194    10224      +30     
+ Misses         239      235       -4     
Impacted Files Coverage Δ
pybamm/solvers/algebraic_solver.py 100.00% <100.00%> (+5.12%) ⬆️
pybamm/solvers/base_solver.py 99.72% <100.00%> (+0.29%) ⬆️
pybamm/solvers/casadi_algebraic_solver.py 100.00% <100.00%> (ø)
pybamm/solvers/casadi_solver.py 100.00% <100.00%> (ø)
pybamm/models/base_model.py 97.81% <0.00%> (-0.44%) ⬇️
pybamm/expression_tree/binary_operators.py 93.10% <0.00%> (-0.32%) ⬇️
pybamm/solvers/idaklu_solver.py 89.42% <0.00%> (+0.96%) ⬆️

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 a9b1081...25b5035. Read the comment docs.

@rtimms rtimms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks!

# set it to 0
if self.algebraic_solver is True and t_eval is None:
t_eval = np.array([0])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we need to raise an error here if t_eval is None and the solver isn't algebraic?

@valentinsulzer valentinsulzer mentioned this pull request Mar 9, 2020
2 of 8 tasks
@valentinsulzer
valentinsulzer merged commit 8edbd53 into develop Mar 9, 2020
@valentinsulzer
valentinsulzer deleted the issue-830-algebraic branch March 9, 2020 22:03
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.

Solving algebraic models

2 participants