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

Move submodels and build model #2169

Merged
merged 10 commits into from
Jul 12, 2022
Merged

Move submodels and build model #2169

merged 10 commits into from
Jul 12, 2022

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Jul 11, 2022

Description

Move general code about submodels to BaseModel instead of BaseBatteryModel. This makes it easier to build custom models from submodels.

Also fixes a bug where SPMe always build even when build=False.

Fixes #2056 #2168

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

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good, thanks Rob!

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #2169 (2f3d4d7) into develop (1cd386d) will decrease coverage by 0.02%.
The diff coverage is 95.00%.

@@             Coverage Diff             @@
##           develop    #2169      +/-   ##
===========================================
- Coverage    99.38%   99.35%   -0.03%     
===========================================
  Files          356      356              
  Lines        19309    19357      +48     
===========================================
+ Hits         19190    19233      +43     
- Misses         119      124       +5     
Impacted Files Coverage Δ
...models/full_battery_models/lead_acid/basic_full.py 100.00% <ø> (ø)
...ybamm/models/full_battery_models/lead_acid/full.py 100.00% <ø> (ø)
...dels/full_battery_models/lead_acid/higher_order.py 98.16% <ø> (ø)
...ybamm/models/full_battery_models/lead_acid/loqs.py 100.00% <ø> (ø)
...bamm/models/full_battery_models/lithium_ion/dfn.py 100.00% <ø> (ø)
...bamm/models/full_battery_models/lithium_ion/mpm.py 100.00% <ø> (ø)
...s/full_battery_models/lithium_ion/newman_tobias.py 100.00% <ø> (ø)
...bamm/models/full_battery_models/lithium_ion/spm.py 100.00% <ø> (ø)
pybamm/models/base_model.py 98.53% <94.62%> (-0.74%) ⬇️
...m/models/full_battery_models/base_battery_model.py 99.75% <100.00%> (-0.02%) ⬇️
... and 2 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 1cd386d...2f3d4d7. Read the comment docs.

@rtimms rtimms merged commit d4c5880 into develop Jul 12, 2022
@rtimms rtimms deleted the issue-2056-build-model branch July 12, 2022 10:56
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.

Move submodels and build_model to BaseModel
2 participants