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 699 remove autograd #723

Merged
merged 23 commits into from
Nov 13, 2019
Merged

Issue 699 remove autograd #723

merged 23 commits into from
Nov 13, 2019

Conversation

valentinsulzer
Copy link
Member

@valentinsulzer valentinsulzer commented Nov 12, 2019

Description

Remove autograd dependency. Also had to reformat the current functions and introduce a Heaviside symbol.

Fixes #699

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 Nov 12, 2019

Codecov Report

Merging #723 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #723      +/-   ##
==========================================
+ Coverage    98.1%   98.13%   +0.03%     
==========================================
  Files         175      172       -3     
  Lines        9196     9188       -8     
==========================================
- Hits         9022     9017       -5     
+ Misses        174      171       -3
Impacted Files Coverage Δ
pybamm/expression_tree/interpolant.py 100% <ø> (ø) ⬆️
pybamm/parameters/parameter_values.py 100% <100%> (ø) ⬆️
pybamm/spatial_methods/scikit_finite_element.py 97.95% <100%> (ø) ⬆️
...mm/expression_tree/operations/convert_to_casadi.py 100% <100%> (ø) ⬆️
pybamm/expression_tree/functions.py 100% <100%> (ø) ⬆️
pybamm/expression_tree/binary_operators.py 98.84% <100%> (+0.4%) ⬆️
pybamm/spatial_methods/finite_volume.py 96.97% <100%> (-0.01%) ⬇️
pybamm/expression_tree/operations/simplify.py 94.98% <100%> (ø) ⬆️
pybamm/discretisations/discretisation.py 99.71% <100%> (ø) ⬆️
...nterface/inverse_kinetics/inverse_butler_volmer.py 100% <100%> (ø) ⬆️
... and 1 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 7f7254c...1ae2106. 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.

this is all much cleaner, thanks @tinosulzer !

function_name.parameters_eval[param] = new_sym.evaluate()

# Create Function or Interpolant objec
# Create Function or Interpolant or Scalar objec
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: object

CHANGELOG.md Outdated
@@ -22,6 +24,7 @@

## Bug fixes

- Improved flexibility of parameter values so that parameters can be set as functions or scalars ([#723](https://github.com/pybamm-team/PyBaMM/pull/723))
Copy link
Contributor

Choose a reason for hiding this comment

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

does this work for things like diffusivity which we assume is a function of some of the variables, or just functions of time/parameters?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should work with both. If something is assumed to be a function in the model then we can pass a scalar and it will always take that scalar value without changing the model. But the other way round (scalar to function) doesn't (can't) work, as you have to tell the model what the function depends on

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.

Problems pickling objects
2 participants