Skip to content

Fix half-cell electrolyte lithium diagnostics - #5765

Merged
rtimms merged 5 commits into
pybamm-team:mainfrom
rtimms:codex/fix-half-cell-electrolyte-lithium
Sep 22, 2026
Merged

rtimms merged 5 commits into
pybamm-team:mainfrom
rtimms:codex/fix-half-cell-electrolyte-lithium

Conversation

@rtimms

@rtimms rtimms commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

Correct half-cell electrolyte lithium inventory to integrate only the separator and working-electrode domains. This also corrects the initial electrolyte-lithium reference used by total-lithium and LLI diagnostics, and fixes the equivalent BasicDFNHalfCell output. Regression tests assert direct physical mass for Xu2019 and downstream diagnostics.

Fixes #5746

Checks

  • uv run --no-sync pytest -m unit packages/pybamm/tests/unit/test_models/test_full_battery_models/test_lithium_ion (642 passed, 12 pre-existing skips)
  • uv run --no-sync pre-commit run --files on all changed files

Draft pending the repository's complete test and documentation-check matrix.

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPyBaMM
Branchcodex/fix-half-cell-electrolyte-lithium
Testbedbare-metal

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

🐰 View full continuous benchmarking report in Bencher

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.15%. Comparing base (469aa12) to head (a6b14ca).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5765   +/-   ##
=======================================
  Coverage   98.15%   98.15%           
=======================================
  Files         341      341           
  Lines       33787    33796    +9     
=======================================
+ Hits        33164    33173    +9     
  Misses        623      623           

☔ 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.

@rtimms
rtimms marked this pull request as ready for review September 22, 2026 09:46
@rtimms
rtimms requested a review from a team as a code owner September 22, 2026 09:46
@rtimms
rtimms enabled auto-merge (squash) September 22, 2026 10:15
@rtimms
rtimms merged commit 9daad12 into pybamm-team:main Sep 22, 2026
40 checks passed
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.

[Bug]: Total lithium in electrolyte [mol] multiplies by the full-cell length L_x in half-cell models

2 participants