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

I2376 bpx #2555

Merged
merged 27 commits into from
Dec 21, 2022
Merged

I2376 bpx #2555

merged 27 commits into from
Dec 21, 2022

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Dec 14, 2022

Description

Add functionality to create pybamm.ParameterValues from a BPX standard json file.

Fixes #2376

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

@rtimms rtimms requested a review from martinjrobins December 14, 2022 14:28
@codecov
Copy link

codecov bot commented Dec 14, 2022

Codecov Report

Base: 99.73% // Head: 99.61% // Decreases project coverage by -0.12% ⚠️

Coverage data is based on head (5325def) compared to base (7800bbc).
Patch coverage: 86.66% of modified lines in pull request are covered.

❗ Current head 5325def differs from pull request most recent head dcd39ab. Consider uploading reports for the commit dcd39ab to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2555      +/-   ##
===========================================
- Coverage    99.73%   99.61%   -0.13%     
===========================================
  Files          270      271       +1     
  Lines        19376    19553     +177     
===========================================
+ Hits         19324    19477     +153     
- Misses          52       76      +24     
Impacted Files Coverage Δ
pybamm/parameters/bpx.py 85.71% <85.71%> (ø)
pybamm/parameters/parameter_values.py 100.00% <100.00%> (ø)
pybamm/citations.py 100.00% <0.00%> (ø)
pybamm/expression_tree/unary_operators.py 100.00% <0.00%> (ø)
...bamm/models/full_battery_models/lithium_ion/mpm.py 100.00% <0.00%> (ø)
.../submodels/electrolyte_diffusion/full_diffusion.py 100.00% <0.00%> (ø)
...e_potential_form/full_surface_form_conductivity.py 100.00% <0.00%> (ø)
pybamm/spatial_methods/finite_volume.py 98.14% <0.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +128 to +131
pybamm_dict[domain.pre_name + "active material volume fraction"] = (
pybamm_dict[domain.pre_name + "surface area per unit volume [m-1]"]
* pybamm_dict[domain.short_pre_name + "particle radius [m]"]
) / 3.0
Copy link
Member

Choose a reason for hiding this comment

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

doing it this way round is very strange

Copy link
Member

@valentinsulzer valentinsulzer 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 to me, some cool python functionality I didn't know about in here :)

Not specifying active volume fraction is weird but that's a BPX thing so 🤷

@@ -0,0 +1,377 @@
from bpx import BPX, Function, InterpolatedTable
Copy link
Member

Choose a reason for hiding this comment

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

this should be a private file with private function names (all start with underscore). I know we haven't been good about this in the past but better late than never (see #2427 )

@rtimms rtimms merged commit c4baa51 into develop Dec 21, 2022
@rtimms rtimms deleted the i2376-bpx branch December 21, 2022 16:51
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.

Create a pybamm.ParameterValues from a BPX file
3 participants