Skip to content

Comments

Update set_initial_state#889

Merged
NicolaCourtier merged 7 commits intodevelopfrom
set-soc-from-voltage
Feb 18, 2026
Merged

Update set_initial_state#889
NicolaCourtier merged 7 commits intodevelopfrom
set-soc-from-voltage

Conversation

@NicolaCourtier
Copy link
Member

Description

Update the set_initial_state functions for models that can take a initial voltage and determine the initial state of charge or stoichiometry. Also, move the Interpolant and InverseOCV classes into a new model utils.py.

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: $ pre-commit run or $ nox -s pre-commit (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctest
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 99.26471% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.31%. Comparing base (4628a65) to head (6a487db).
⚠️ Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
pybop/models/lithium_ion/utils.py 98.03% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #889      +/-   ##
===========================================
+ Coverage    89.41%   92.31%   +2.90%     
===========================================
  Files           63       72       +9     
  Lines         4857     5390     +533     
===========================================
+ Hits          4343     4976     +633     
+ Misses         514      414     -100     

☔ 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

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

I only have one comment: there's quite a lot of code duplication in set_initial_state (as far as I can tell). It might be better to have a pybop.lithium_ion.BaseModel with that method, from which all other classes are initialised.

I'm not too attached to this though, so if you think it's better to keep it as is, happy to approve.

@NicolaCourtier NicolaCourtier merged commit 0468623 into develop Feb 18, 2026
31 checks passed
@NicolaCourtier NicolaCourtier deleted the set-soc-from-voltage branch February 18, 2026 14:45
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