Skip to content

Remove harmonic mean regularization - #4977

Merged
kratman merged 5 commits into
developfrom
mdb/remove-regularization-terms
Apr 16, 2025
Merged

Remove harmonic mean regularization#4977
kratman merged 5 commits into
developfrom
mdb/remove-regularization-terms

Conversation

@MarcBerliner

Copy link
Copy Markdown
Member

Description

Removes a regularization factor of 1e-16 in the diffusion coefficient harmonic mean. I believe this term was included when pybamm still used normalized variables, but now it's unnecessary and causes noticeable error.

Minor things:

  • Changes harmonic mean functional form to reduce the number of diffusion variables in codegen
  • Reduces the size of a magic number in FunctionParameter from 1e-16 to 1e-300

Fixes #4976

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

change the functional form of the harmonic mean to reduce number of diffusion variables in codegen
@MarcBerliner
MarcBerliner requested a review from a team as a code owner April 16, 2025 16:16
@codecov

codecov Bot commented Apr 16, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (1afcea2) to head (4d76a52).
Report is 111 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4977   +/-   ##
========================================
  Coverage    98.64%   98.64%           
========================================
  Files          304      304           
  Lines        23750    23750           
========================================
  Hits         23429    23429           
  Misses         321      321           

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

@aabills aabills 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.

looks great, thanks!

@kratman
kratman merged commit 1f5c22c into develop Apr 16, 2025
@kratman
kratman deleted the mdb/remove-regularization-terms branch April 16, 2025 19:40
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.

Simulation inaccuracy induced by model processing

3 participants