Skip to content

Add Bonkile2024 Parameter Set - #5694

Open
Dharshannan wants to merge 4 commits into
pybamm-team:mainfrom
Dharshannan:develop
Open

Add Bonkile2024 Parameter Set#5694
Dharshannan wants to merge 4 commits into
pybamm-team:mainfrom
Dharshannan:develop

Conversation

@Dharshannan

Copy link
Copy Markdown

Description

This PR adds the Mayur2024 lithium-ion parameter set as a built-in PyBaMM parameter set and registers it through the pybamm_parameter_sets entry-point mechanism.

The implementation includes:

  • Addition of the Mayur2024 parameter set and supporting data files.
  • Registration of the parameter set within pyproject.toml.
  • Addition of the required package structure and exports so that the parameter set can be loaded through the standard PyBaMM interface.

The new parameter set can now be accessed directly using

param = pybamm.ParameterValues("Mayur2024")

in the same manner as existing parameter sets such as Chen2020 and OKane2022.

Motivation

This change enables the direct use of the parameter set without requiring manual imports or user-side registration. Integrating the parameter set into the existing entry-point framework ensures consistency with the rest of the PyBaMM ecosystem and simplifies model development and reproducibility.

Type of change

  • Feature

Checklist

  • No style issues (nox -s pre-commit)
  • All tests pass (nox -s tests)
  • Documentation builds successfully (nox -s doctests)
  • Code has been commented where necessary
  • Tests have been added to verify correct registration and loading of the parameter set

Added Mayur2024 parameter file for composite degradation (Si/Gr anode) and tested.
@Dharshannan
Dharshannan requested a review from a team as a code owner August 4, 2026 14:51
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.21%. Comparing base (d63699d) to head (a93b7b6).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5694    +/-   ##
========================================
  Coverage   98.21%   98.21%            
========================================
  Files         339      341     +2     
  Lines       31996    32869   +873     
========================================
+ Hits        31424    32282   +858     
- Misses        572      587    +15     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dharshannan

Copy link
Copy Markdown
Author

Closing PR as no response.

@Dharshannan Dharshannan closed this Sep 1, 2026
@rtimms rtimms reopened this Sep 2, 2026

@rtimms rtimms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reopening — this is a useful contribution, but the citation wiring needs fixing before it can go in. Sorry for the slow response.

The main issue: the publication these parameters actually come from is never registered as a citation.

1. The source paper is not cited

The get_parameter_values() docstring names the source in plain prose:

Beginning-of-life and degradation … parameters … are taken from the supplementary information of Bonkile et al., "Is silicon worth it? Modelling degradation in composite silicon/graphite lithium-ion battery electrodes"

But the registered list is:

"citations": ["Chen2020", "Ai2022", "OKane2022", "OKane2020", "Ai2020"],

Bonkile 2024 is absent, and there is no Bonkile2024 key in packages/pybamm/src/pybamm/CITATIONS.bib. So pybamm.print_citations() lists the upstream papers the parameters derive from, but never the paper they were actually taken from — which is the one a user of this set needs to cite.

Please add to CITATIONS.bib (alphabetically, between Beeckman1990 and BrosaPlanella2021):

@article{Bonkile2024,
  title   = {Is silicon worth it? Modelling degradation in composite silicon--graphite lithium-ion battery electrodes},
  journal = {Journal of Power Sources},
  volume  = {606},
  pages   = {234256},
  year    = {2024},
  issn    = {0378-7753},
  doi     = {https://doi.org/10.1016/j.jpowsour.2024.234256},
  url     = {https://www.sciencedirect.com/science/article/pii/S0378775324002076},
  author  = {Mayur P. Bonkile and Yang Jiang and Niall Kirkaldy and Valentin Sulzer and Robert Timms and Huizhi Wang and Gregory Offer and Billy Wu}
}

then put "Bonkile2024" first in the citations list, and change the docstring prose to :footcite:t:`Bonkile2024` so it renders like the neighbouring references.

2. Ai2020 is not a valid citation key, and it breaks the whole citation print

CITATIONS.bib has Ai2019 and Ai2022 — there is no Ai2020. The existing Ai2020.py parameter set registers "citations": ["Ai2019"].

So this key falls through _parse_citation into _unknown_citations, and pybamm.print_citations() emits Citation with key "Ai2020" is invalid. Worse, the except KeyError in Citations.print sits outside the for key in self._unknown_citations loop, so one bad key aborts parsing of every remaining unknown citation. Should be Ai2019.

3. The same bad key breaks the docs build

The docstring contains :footcite:t:`Ai2020`, which sphinxcontrib-bibtex cannot resolve — broken reference in the API docs. nox -s doctests doesn't build the docs, so the checklist wouldn't have caught it.

4. Yang2017 is cited in prose but not registered

The docstring attributes the SEI parameters to :footcite:t:`Yang2017` (that key does exist in CITATIONS.bib), but it's missing from the citations list. Please add it.

5. The parameter set is named after the first author's given name

Mayur2024 — the author is Mayur P. Bonkile. Every other set here is surname+year (Chen2020, OKane2022, ORegan2022, BrosaPlanella2022). This should be Bonkile2024.

This is more than cosmetic: the name is the entry-point key in pyproject.toml and the public pybamm.ParameterValues("…") string, so renaming it after a release is a breaking change. Better to get it right now.

Minor

  • input/parameters/lithium_ion/__init__.py: 'Xu2019', 'Mayur2024', ] has a trailing comma plus a space before ], and the list is otherwise alphabetical — it belongs after 'Marquis2019'.

  • In the returned dict:

    "Electrolyte conductivity [S.m-1]"
    "": electrolyte_conductivity_Nyman2008_arrhenius,

    That's an implicit string concatenation, so the key ends up as "Electrolyte conductivity [S.m-1]" via a two-part literal rather than as written. Looks like a bad reflow — please make it a single key on one entry.

@rtimms

rtimms commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@Dharshannan, thanks for this contribution! In future feel free to ping specific people for review - due to the increasing number of PRs, things sometimes get buried in the noise of GitHub notifications.

Addresses PR review comments on the composite Si/graphite parameter set:

- Rename the parameter set from Mayur2024 to Bonkile2024 (surname+year,
  matching every other set's convention) before release makes it a
  breaking change. Renamed the module, and updated the pyproject.toml
  entry point and the lithium_ion __init__.py __all__ list (placed
  alphabetically, dropped the trailing comma before the closing bracket).
- Register the actual source paper as a citation: added a Bonkile2024
  BibTeX entry to CITATIONS.bib (alphabetically between Beeckman1990 and
  BrosaPlanella2021), put "Bonkile2024" first in the parameter set's
  citations list, and changed the get_parameter_values() docstring's
  plain-prose attribution to :footcite:t:`Bonkile2024` so it renders
  like the neighbouring references.
- Fix the invalid "Ai2020" citation key (no such entry in CITATIONS.bib)
  to "Ai2019", both in the citations list and in a docstring footcite
  reference -- this was breaking pybamm.print_citations() for every
  remaining unknown citation, and breaking the docs build.
- Register "Yang2017", which was already cited in prose but missing
  from the citations list.
- Fix an accidental implicit string concatenation that split
  "Electrolyte conductivity [S.m-1]" across two literals for no reason.

Verified every :footcite:t: key in the file resolves against
CITATIONS.bib and is present in the citations list (checked
programmatically in both directions).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Dharshannan

Copy link
Copy Markdown
Author

@rtimms I have revised the PR as per your review. Please feel free to accept and merge. Thank you.

@Dharshannan
Dharshannan requested a review from rtimms September 4, 2026 11:22
@Dharshannan Dharshannan changed the title Add Mayur2024 Parameter Set Add Bonkile2024 Parameter Set Sep 4, 2026
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.

2 participants