PyBaMM 26.7.0.0
·
38 commits
to main
since this release
Breaking changes
- The minimum supported NumPy version is now
2.0.0for bothpybammandpybammsolvers(previously unpinned). NumPy 1.x is no longer supported. (#5647) - The "voltage as a state" model option now defaults to "true": voltage is solved as an algebraic state, making standard models DAEs. Reading
Voltage [V]from a solution is now an O(1) state lookup instead of a post-solve expression evaluation (up to 73% faster end-to-end for dense output; 8-24% faster experiment cycling across SPM/SPMe/DFN; up to 48% faster with in-solveroutput_variables=["Voltage [V]"]). The defaultIDAKLUSolver,CasadiSolver(all modes), andJaxSolver(method="BDF")handle DAEs; ODE-only solvers (ScipySolver,JaxSolver(method="RK45")) require{"voltage as a state": "false", "surface form": "false"}for SPM/SPMe, which remains a supported configuration. Known trade-off: continuous solves of rapidly alternating current profiles (e.g. interpolant drive cycles with more than ~25 current reversals in one solve) can be slower, up to ~2x for SPM in the worst measured case; the legacy configuration above restores previous performance for these workloads. Experiment-driven cycling is unaffected. (#5573) CasadiSolver,ScipySolver, andCasadiAlgebraicSolverare deprecated; useIDAKLUSolver(orNonlinearSolverfor algebraic systems) instead. It is now the default for every model. (#5624)
Features
pybammsolversnow ships Linuxaarch64(arm64) wheels, built onmanylinux_2_34native ARM runners. The libstdc++std::stringABI (_GLIBCXX_USE_CXX11_ABI) is now detected from the linked CasADi library instead of hard-coded, resolving the unresolved-symbol failure against CasADi's C++11-ABI aarch64 wheel. (#5653)- Added
skip_surface_form_checkoption toEISSimulationto bypass the surface form validation. (#5632) - Added ability to export pybamm.Simulation with experiments to DiffSL format (#5557)
- PyBaMM and
pybammsolversnow develop in a single repository — a UV workspace underpackages/— while continuing to release independently to PyPI. Release tags are namespaced (pybamm-v*andpybammsolvers-v*), and PyBaMM's CI now tests against the in-repo solver on every platform. The publishedpybammpackage and its dependency onpybammsolversare unchanged for users. SeeRELEASE.mdfor the release model. (#5512) - Legacy BPX v0.x files/objects now load again:
bpxitself detects and converts them to the v1.x schema on a best-effort basis (with aUserWarning), soParameterValues.create_from_bpx/create_from_bpx_objno longer raise aValidationError. PyBaMM officially supportsbpx>=1. (#5574) create_from_bpx/create_from_bpx_objnow also accept BPX files that omitStatefields (or the wholeStatesection): the ambient/initial temperatures default to the reference temperature and the initial electrolyte concentration to 1000 mol.m-3 (logged), while opt-in fields (initial hysteresis state, heat transfer coefficient) are left for the model to default. (#5574)
Bug fixes
- Fixed
ParameterValues.to_json(andSerialiseof parameter values) raisingTypeError: ... got multiple values for argumentoncreate_from_bpxoutputs, whose functional parameters arefunctools.partialobjects with keyword-bound arguments (e.g. constant diffusivity, tabular OCPs, exchange-current density). The serialiser now only creates symbols for a partial's remaining required arguments, leaving bound and defaulted arguments in place. (#5641) - Fixed the Dependabot
uvupdate job failing to resolve the workspace (ModuleNotFoundError: No module named 'scikit_build_core'):pybammsolversnow declares a staticversioninpyproject.toml, so build-tool-less resolvers read its metadata without invoking the scikit-build-core backend.version.pyremains the single source of truth, mirrored intopyproject.tomlandvcpkg.jsonby a newsync-pybammsolvers-versionpre-commit hook. (#5655) - Fixed the
pybammsolversWindows wheels failing to build: vcpkg's transitive reference-LAPACK/Fortran toolchain chain broke on a pruned upstream MSYS2 download (a 404). The Windows build now avoids that chain, using asuitesparse-klu-only sundials port and vcpkg 2026.06.24 on awindows-2025runner. (#5650) - Fixed the deprecated
"<X> electrode diffusivity [m2.s-1]"alias silently overriding the current"<X> particle diffusivity [m2.s-1]": the current name now takes precedence inParameterValues(instead of being overwritten by the deprecated alias), and a warning is raised when both are set, so setting or fittingparticle diffusivityis no longer a silent no-op. The deprecated key is retained for backward compatibility, andcreate_from_bpxnow emits only the currentparticle diffusivityname. (#5642) - Fixed the
pybammsolverssource distribution bundling the SUNDIALS/SuiteSparse submodule trees (~291 MB, over PyPI's per-file limit) when built from a checkout with the submodules initialised; the sdist now excludes them. (#5623) - Fixed the
pybammsolverseditable auto-rebuild failing to configure when the SUNDIALS/SuiteSparse submodules are absent even though the libraries were already built in.idaklu; the from-source bootstrap (and its submodule requirement) is now skipped once the libraries exist. (#5623) - Fixed the Read the Docs documentation build, which broke once
pybammsolversbecame a workspace member with no published wheel during the release: RTD now fetches the SUNDIALS/SuiteSparse submodules and installsgfortran/libopenblasso the solver builds from source. Link checking was also restructured so transient external-link failures no longer block builds: Sphinxlinkcheckis advisory, and the CIlycheecheck runs offline on PRs with a weekly external sweep that files a tracking issue. (#5659)