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

Fixes #4176 electrode diffusivity rename #4179

Merged

Conversation

BradyPlanden
Copy link
Member

@BradyPlanden BradyPlanden commented Jun 14, 2024

Description

Fixes #4176. In addition to this issue, in the develop implementation changes to electrode diffusivity via parameter_values.update() will not be captured. To account for this, the I've taken the depreciated key and appended the new key into parameter_set dictionary in the event that the depreciated parameter is supplied. This also cleans up the bpx.py implementation since the logic for changing the key is moved into the parameters class.

Fixes # (issue)

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: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

…. check_parameter_values to rename depreciated key
…' without destroying 'electrode diffusivity', updts tests to verify functionality
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.58%. Comparing base (088ca38) to head (c199d3e).
Report is 226 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4179   +/-   ##
========================================
  Coverage    99.58%   99.58%           
========================================
  Files          288      288           
  Lines        21799    21800    +1     
========================================
+ Hits         21708    21709    +1     
  Misses          91       91           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@agriyakhetarpal
Copy link
Member

Hi @ejfdickinson, would be able to try these changes out? Also, thanks for flagging this at a reasonable time before the release and thank you @BradyPlanden for taking it!

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Just one nitpicky typo suggestion – I don't understand the BPX code enough so I will leave it to someone else to approve but the rest of the changes look good to me, thanks!

tests/unit/test_parameters/test_bpx.py Outdated Show resolved Hide resolved
@ejfdickinson
Copy link

@agriyakhetarpal @BradyPlanden The test I made is passing with these changes, so seems ok to me. Note also typoes in the changelog!

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 to me, especially if it fixes @ejfdickinson example.

CHANGELOG.md Outdated Show resolved Hide resolved
BradyPlanden and others added 2 commits June 18, 2024 16:13
Co-authored-by: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
@brosaplanella brosaplanella merged commit 23bebd0 into pybamm-team:develop Jun 21, 2024
26 checks passed
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
* fix: revert logic change for failing 'particle diffusivity' key, updt. check_parameter_values to rename depreciated key

* fix: removes bpx remapping requirement, creates 'particle diffusivity' without destroying 'electrode diffusivity', updts tests to verify functionality

* Add changelog

* Apply suggestions from code review

Co-authored-by: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>

---------

Co-authored-by: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants