Skip to content

Composite esoh half cell#5179

Merged
aabills merged 4 commits intopybamm-team:developfrom
aabills:composite-esoh-half-cell
Sep 2, 2025
Merged

Composite esoh half cell#5179
aabills merged 4 commits intopybamm-team:developfrom
aabills:composite-esoh-half-cell

Conversation

@aabills
Copy link
Contributor

@aabills aabills commented Aug 28, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

- Add TestElectrodeSOHHalfCell class with composite electrode tests
- Create _get_params_and_options_composite_half_cell helper method
- Test composite positive electrode using Chen2020_composite negative parameters
- Add voltage and SOC initialization tests with proper tolerances (1e-5)
- Set voltage cutoffs: lower=0.00001V, upper=2.5V
- Remove unnecessary parameters (particle radii, exchange current densities, diffusion coefficients)
- Include comprehensive error handling tests
- Use proper pytest.approx() assertions instead of manual abs() comparisons

All tests pass and validate composite electrode SOH functionality.
@aabills aabills marked this pull request as ready for review August 28, 2025 18:56
@aabills aabills requested a review from a team as a code owner August 28, 2025 18:56
@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.88%. Comparing base (acff2a2) to head (b4d5383).
⚠️ Report is 98 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5179   +/-   ##
========================================
  Coverage    98.87%   98.88%           
========================================
  Files          320      320           
  Lines        26872    26949   +77     
========================================
+ Hits         26571    26648   +77     
  Misses         301      301           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

Thanks, implementation looks good but I wonder if it is better for the composite model to be a separate class for consistency with the full cell model? Or make the full-cell one into a single class that then calls the standard or composite version based on the options?

@aabills
Copy link
Contributor Author

aabills commented Aug 29, 2025

Thanks, implementation looks good but I wonder if it is better for the composite model to be a separate class for consistency with the full cell model? Or make the full-cell one into a single class that then calls the standard or composite version based on the options?

I have no preference, let me know what you prefer. The interesting thing about the half cell case is that the composite is just one additional equation that can be solved totally separately, so we can just add an additional model class for that if you want, right now I just do it in an if statement.

@rtimms
Copy link
Contributor

rtimms commented Sep 2, 2025

Let's merge as-is for now so as not to overcomplicate things. Later we should unify the esoh code as it is a bit complicated.

@aabills aabills merged commit a1aa02c into pybamm-team:develop Sep 2, 2025
35 of 38 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.

2 participants