Repository navigation
Build the solvers from PyBaMM main in the PyBaMM main job - #52
Merged
Merged
Conversation
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]>
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:
|
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the "PyBaMM main (non-blocking)" job, which fails on every branch,
mainincluded.Cause
PyBaMM
mainis a uv workspace that also holds the solvers,packages/pybammsolvers, and their version is only bumped at a release: onmainit is0.11.1, the same as the release on PyPI, although the code has moved on. The job installedpybammfrommainbut tookpybammsolversfrom PyPI, to avoid compiling it. PyBaMMmainnow callspybammsolvers.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:mainwith its submodules (SUNDIALS, SuiteSparse);gfortranandlibopenblas-dev, the packages PyBaMM's tests install;pybammsolversandpybammfrom 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 withactions/cache, keyed on what it is built from: the submodule pins andinstall_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/workflowsneed theworkflowscope.🤖 Generated with Claude Code