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 865 interface #866

Merged
merged 9 commits into from
Mar 4, 2020
Merged

Issue 865 interface #866

merged 9 commits into from
Mar 4, 2020

Conversation

valentinsulzer
Copy link
Member

Description

Reformatted interface submodels.

Fixes #865

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 Feb 28, 2020

Codecov Report

Merging #866 into develop will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #866      +/-   ##
===========================================
+ Coverage    97.66%   97.70%   +0.03%     
===========================================
  Files          207      201       -6     
  Lines        10510    10415      -95     
===========================================
- Hits         10265    10176      -89     
+ Misses         245      239       -6     
Impacted Files Coverage Δ
...bmodels/interface/first_order_kinetics/__init__.py 100.00% <0.00%> (ø)

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 bf5283c...099631a. 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.

thanks @tinosulzer the structure for the kinetics is now much clearer!

the only comment I have is that having the if statements for things like _get_exchange_current_density could get long if people start adding lots more reactions. I think it is ok for now though. maybe a solution is to have a reactions class that gets instatiated inside the init of base_interface so that the definitions of _get_exchange_current_density are shifted to separate files. I know we had separate files for lithium-ion main, lead-acid main etc. before but they had definitions of classes at the end with double inheritence, which I found confusing.

Anyway I think what you've done looks great and clears things up a lot, and we can revisit the reactions if and when people start to implement a lot more.


def _get_exchange_current_density(self, variables):
"""
A private function to obtain the exchange current density for a lead acid
Copy link
Contributor

Choose a reason for hiding this comment

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

both lead acid and lithium ion?

@valentinsulzer
Copy link
Member Author

Thanks, yeah I didn't know how to keep it with separate classes but not do double inheritance, can rethink again if it becomes too long

@valentinsulzer valentinsulzer merged commit 6ff39b9 into develop Mar 4, 2020
@valentinsulzer valentinsulzer deleted the issue-865-interface branch March 4, 2020 18:15
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.

Reformat interface submodels
2 participants