[Bug]: Deprecation warning for "electrode diffusivity" names the old and new parameter the wrong way round
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
In util.py, inspect FuzzyDict.__getitem__ and locate the unit test that checks the deprecation warning for the renamed electrode diffusivity parameter. Update the warning text and assert its expected message, then run that focused test. Done means looking up the old parameter name returns the new parameter value and reports the old and new names in the correct order.
Written by the indexing model from the issue text.
Description
PyBaMM Version
main @ 635340c09
Python Version
3.13
Describe the bug
The parameter was renamed from "... electrode diffusivity [m2.s-1]" to "... particle diffusivity [m2.s-1]" (#3770). When you look up the old name, FuzzyDict.__getitem__ (util.py) warns that the new name has been renamed to the old one and says it is using the old one. In fact it returns the value of the new one. The unit test only checks the warning class, not the text.
Steps to Reproduce
import warnings
import pybamm
params = pybamm.ParameterValues("Chen2020")
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
params["Negative electrode diffusivity [m2.s-1]"]
print(w[0].message)
Relevant log output
The parameter 'Negative particle diffusivity [m2.s-1]' has been renamed to 'Negative electrode diffusivity [m2.s-1]' and will be removed in a future release. Using 'Negative electrode diffusivity [m2.s-1]'
Expected: "The parameter 'Negative electrode diffusivity [m2.s-1]' has been renamed to 'Negative particle diffusivity [m2.s-1]' ... Using 'Negative particle diffusivity [m2.s-1]'". I'm happy to open a PR that swaps the two and asserts the message in the test.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 808
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pybamm-team/PyBaMM
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pybamm-team/PyBaMM#6061 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
pybamm-team/PyBaMM#6051 ·
Maintainers usually reply within 2 days
-
Composite positive half cell: get_initial_stoichiometry_half_cell inverts SOC (SOC 1 returns the 0% stoichiometry)Possibly taken @Mohit-Ak claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
pybamm-team/PyBaMM#6007 ·
Maintainers usually reply within 2 days
-
[Bug]: BatchStudy.solve silently ignores t_interpPossibly taken @shresthgoel77-png claimed this 22 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pybamm-team/PyBaMM#5978 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
pybamm-team/PyBaMM#5692 · 12 comments ·
Maintainers usually reply within 2 days
All issues in pybamm-team/PyBaMM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
btclib-org/btclib-wallet#1045 ·
Maintainers usually reply within 1 day
-
area-templates triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/aspire#22356 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[Train] An elastic ScalingConfig(num_workers=(0, 0)) is accepted and the run waits foreverPossibly taken @wguo7 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ray-project/ray#68217 ·
Maintainers usually reply within 2 days