Skip to content

feat: change default solver to idaklu - #4915

Merged
martinjrobins merged 25 commits into
developfrom
i4914-idaklu-default
Apr 10, 2025
Merged

martinjrobins merged 25 commits into
developfrom
i4914-idaklu-default

Conversation

@martinjrobins

@martinjrobins martinjrobins commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Description

Fixes #4914

Note: as part of this change I've had to relax a lot of the test tolerances, due to the different default tolerances that we have for the IDAKLU solver. If users have existing code that uses the default solver and tolerances, this might fail suddenly when they upgrade. We have to think about how to handle this

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)

Key checklist:

  • 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: $ python -m pytest (or $ nox -s tests)
  • The documentation builds: $ python -m pytest --doctest-plus src (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ nox -s quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@martinjrobins
martinjrobins requested a review from a team as a code owner March 13, 2025 20:01
@codecov

codecov Bot commented Mar 13, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 86.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 98.64%. Comparing base (bc5f030) to head (153d77c).
Report is 81 commits behind head on develop.

Files with missing lines Patch % Lines
src/pybamm/solvers/idaklu_solver.py 85.71% 7 Missing ⚠️
src/pybamm/models/base_model.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4915      +/-   ##
===========================================
- Coverage    98.70%   98.64%   -0.06%     
===========================================
  Files          304      304              
  Lines        23701    23742      +41     
===========================================
+ Hits         23394    23421      +27     
- Misses         307      321      +14     

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

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

pipliggins
pipliggins previously approved these changes Apr 7, 2025

@pipliggins pipliggins 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 good to me aside from the missing coverage + a changelog entry :)

Would adding a temporary warning on the base solver if the tolerances aren't the default values work for letting users know about the change?

@martinjrobins

Copy link
Copy Markdown
Contributor Author

Looks good to me aside from the missing coverage + a changelog entry :)

Would adding a temporary warning on the base solver if the tolerances aren't the default values work for letting users know about the change?

good idea, I've added a warning if users use the default solver. We can remove it after a couple of releases

@martinjrobins
martinjrobins requested a review from pipliggins April 9, 2025 15:06
@MarcBerliner

Copy link
Copy Markdown
Member

@martinjrobins one minor request: can we also update the readme to use the IDAKLUSolver instead of casadi?

@martinjrobins

Copy link
Copy Markdown
Contributor Author

@martinjrobins one minor request: can we also update the readme to use the IDAKLUSolver instead of casadi?

good point, added this now

@martinjrobins
martinjrobins merged commit d88beaf into develop Apr 10, 2025
@martinjrobins
martinjrobins deleted the i4914-idaklu-default branch April 10, 2025 07:58
@brosaplanella

Copy link
Copy Markdown
Member

I am a bit confused, did this make it in the release or not?

@agriyakhetarpal

Copy link
Copy Markdown
Member

No, it didn't make it to the release, @brosaplanella

@brosaplanella

brosaplanella commented Apr 10, 2025 •

Copy link
Copy Markdown
Member

Then we need to update the CHANGELOG, as it has included under the 25.4 section (I will try to draft the release notes over the weekend).

Accurio added a commit to Accurio/liionpack that referenced this pull request Apr 27, 2026
Starting from PyBaMM 25.4.1, the IDAKLU solver becomes the default,
which requiring relaxing a lot of the test tolerances.
(pybamm-team/PyBaMM#4915)
Accurio added a commit to Accurio/liionpack that referenced this pull request Jun 6, 2026
Starting from PyBaMM 25.4.1, the IDAKLU solver becomes the default,
which requiring relaxing a lot of the test tolerances.
(pybamm-team/PyBaMM#4915)
Accurio added a commit to Accurio/liionpack that referenced this pull request Jun 6, 2026
Starting from PyBaMM 25.4.1, the IDAKLU solver becomes the default,
which requiring relaxing a lot of the test tolerances.
(pybamm-team/PyBaMM#4915)
Accurio added a commit to Accurio/liionpack that referenced this pull request Jul 1, 2026
Starting from PyBaMM 25.4.1, the IDAKLU solver becomes the default,
which requiring relaxing a lot of the test tolerances.
(pybamm-team/PyBaMM#4915)
Accurio added a commit to Accurio/liionpack that referenced this pull request Jul 26, 2026
Starting from PyBaMM 25.4.1, the IDAKLU solver becomes the default,
which requiring relaxing a lot of the test tolerances.
(pybamm-team/PyBaMM#4915)
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.

change default solver to idaklu

5 participants