Skip to content

Fix SPMe Surface Form Discrepancy #4986

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

vidipsingh
Copy link
Contributor

Description

This PR resolves the mismatch between surface form = "false" and algebraic in SPMe for single-phase configs, ensuring consistent results. It also improves validation for particle phases = ("1", "1") to avoid unintended overrides.

Fixes: #4910

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

@vidipsingh vidipsingh requested a review from a team as a code owner April 19, 2025 12:58
@vidipsingh
Copy link
Contributor Author

vidipsingh commented Apr 19, 2025

Hi @valentinsulzer, I've made these changes:

  • Ensured surface form = "false" and "algebraic" match for single-phase SPMe ("particle phases": ("1", "1")) by using delta_phi = phi_s - phi_e in CompositeAlgebraic, with validation, and logging.
  • Fixed the particle phases override bug by defaulting to "false" for single-phase setups.

Is this approach correct? Any feedback would be very helpful!

Copy link

codecov bot commented Apr 20, 2025

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.61%. Comparing base (eb9f5fc) to head (9404ebd).

Files with missing lines Patch % Lines
...amm/models/full_battery_models/lithium_ion/spme.py 87.50% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4986      +/-   ##
===========================================
- Coverage    98.62%   98.61%   -0.01%     
===========================================
  Files          304      304              
  Lines        23755    23784      +29     
===========================================
+ Hits         23428    23455      +27     
- Misses         327      329       +2     

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

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]: SPMe surface form "false" and "algebraic" give different answers
2 participants