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 963 misc bugs #971

Merged
merged 15 commits into from
Apr 29, 2020
Merged

Issue 963 misc bugs #971

merged 15 commits into from
Apr 29, 2020

Conversation

valentinsulzer
Copy link
Member

@valentinsulzer valentinsulzer commented Apr 28, 2020

Description

  • Add some extra checks when creating model
  • Make grad (broadcast) and div(broadcast) automatically return broadcast(0)
  • don't allow rediscretising a model once discretised (if allowed, it usually fails anyway)

Fixes #963

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
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #971 into develop will increase coverage by 0.16%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #971      +/-   ##
===========================================
+ Coverage    97.36%   97.52%   +0.16%     
===========================================
  Files          222      222              
  Lines        11689    12001     +312     
===========================================
+ Hits         11381    11704     +323     
+ Misses         308      297      -11     
Impacted Files Coverage Δ
...amm/models/submodels/convection/base_convection.py 100.00% <ø> (+27.50%) ⬆️
pybamm/simulation.py 98.41% <ø> (ø)
pybamm/discretisations/discretisation.py 99.77% <100.00%> (+<0.01%) ⬆️
pybamm/expression_tree/functions.py 100.00% <100.00%> (ø)
pybamm/expression_tree/operations/simplify.py 95.14% <100.00%> (+0.05%) ⬆️
pybamm/expression_tree/symbol.py 97.46% <100.00%> (+0.01%) ⬆️
pybamm/expression_tree/unary_operators.py 96.51% <100.00%> (+0.12%) ⬆️
pybamm/meshes/meshes.py 98.93% <100.00%> (+0.02%) ⬆️
pybamm/models/base_model.py 98.78% <100.00%> (+0.11%) ⬆️
pybamm/models/submodels/base_submodel.py 91.93% <100.00%> (-0.72%) ⬇️
... and 11 more

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 6852e0e...1ace4ed. Read the comment docs.

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

great, thanks!

@@ -4,6 +4,22 @@
import casadi
import pybamm
import numpy as np
from scipy.interpolate import interp1d
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this is out of date with the changes to casadi, but should be fixed by merging

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah thanks, I was wondering why the tests were failing

@valentinsulzer valentinsulzer changed the base branch from develop to master April 29, 2020 13:03
@valentinsulzer valentinsulzer changed the base branch from master to develop April 29, 2020 13:04
@valentinsulzer valentinsulzer merged commit 0805104 into develop Apr 29, 2020
@valentinsulzer valentinsulzer deleted the issue-963-misc-bugs branch April 29, 2020 15:59
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.

Better error messages
2 participants