Skip to content

Build the solvers from PyBaMM main in the PyBaMM main job - #52

Merged
brosaplanella merged 2 commits into
mainfrom
ci-pybamm-main-solvers
Oct 31, 2026
Merged

brosaplanella merged 2 commits into
mainfrom
ci-pybamm-main-solvers

Conversation

@brosaplanella

Copy link
Copy Markdown
Contributor

Fixes the "PyBaMM main (non-blocking)" job, which fails on every branch, main included.

Cause

PyBaMM main is a uv workspace that also holds the solvers, packages/pybammsolvers, and their version is only bumped at a release: on main it is 0.11.1, the same as the release on PyPI, although the code has moved on. The job installed pybamm from main but took pybammsolvers from PyPI, to avoid compiling it. PyBaMM main now calls pybammsolvers.idaklu.shares_python_casadi, which no release has, so every test that builds a solver errors. No version constraint can catch this, as both report the same version.

Fix

Build both packages from PyBaMM main's source, as PyBaMM's own tests do:

  • check out PyBaMM main with its submodules (SUNDIALS, SuiteSparse);
  • install gfortran and libopenblas-dev, the packages PyBaMM's tests install;
  • install pybammsolvers and pybamm from that checkout.

SUNDIALS and SuiteSparse take most of the build time. They are built into packages/pybammsolvers/.idaklu, which the solver module finds through an absolute RPATH, so that folder is cached with actions/cache, keyed on what it is built from: the submodule pins and install_KLU_Sundials.py. On a cache hit only the solver module is compiled. The job stays non-blocking.

To check

This could not be tested locally (no Fortran compiler or BLAS in the sandbox), so the first run of "PyBaMM main (non-blocking)" on this PR is the test; expect it to be slower while the cache is empty.

Pushed by the maintainer: changes under .github/workflows need the workflow scope.

🤖 Generated with Claude Code

PyBaMM main holds the solvers too (packages/pybammsolvers), and their
version is only bumped at a release, so the job took the PyPI wheel even
when main needed newer solver code: every test failed once main called a
solver function no release had. Check out PyBaMM main with its
submodules and install both packages from it, as PyBaMM's own tests do.
SUNDIALS and SuiteSparse, the slow part, are cached, keyed on the
submodule pins and their build script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brosaplanella brosaplanella added the no changelog Skip entry in CHANGELOG label Oct 31, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 PyTES | 🛠️ Build #35545082 | 📁 Comparing 8f023e1 against latest (3b5acbe)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff            @@
##              main       #52   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         1768      1767    -1     
  Branches       157       157           
=========================================
- Hits          1768      1767    -1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Through its workspace sources pybamm pulled in pybammsolvers as an
editable install, which rebuilt itself with CMake on import, in an
environment without pybind11. Install both without the sources, so the
solvers are an ordinary install. Fetch PyBaMM's history (without file
contents) so that pybamm gets its version from its tags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brosaplanella
brosaplanella merged commit 6f6211d into main Oct 31, 2026
20 checks passed
@brosaplanella
brosaplanella deleted the ci-pybamm-main-solvers branch October 31, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Skip entry in CHANGELOG

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant