Skip to content

v26.6.0.0

Choose a tag to compare

@BradyPlanden BradyPlanden released this 04 Jun 14:43
8daf72a

Breaking changes

  • Electrode electronic conductivity supplied as a function must now accept (stoichiometry, temperature). A constant value is unaffected, but a conductivity function previously written as f(temperature) must be updated to f(stoichiometry, temperature); supplying a temperature-only function now raises a clear error pointing at the new signature. (#5556)

Features

  • Electrode electronic conductivity can now be specified as a function of stoichiometry (in addition to temperature) for all lithium-ion and sodium-ion models. (#5556)
  • Unified PyBaMM serialisation onto a single safe-or-loud encode/decode kernel. Serialisation now either round-trips or raises SerialisationError, never silently dropping a field, across the expression tree, discretised models, meshes, solvers, experiments and parameter values. There is one canonical on-disk format, and files saved by older PyBaMM versions continue to load via backward-compatible readers. Note that save_model(model, mesh=...) now raises for meshes containing submeshes that cannot round-trip (those without a _from_json hook, e.g. Exponential1DSubMesh); previously the save succeeded but the mesh could not be reloaded. Derived caches such as Array.entries_string are no longer stored on disk and are recomputed from the stored entries on load, so a stale value in a legacy file is replaced by the recomputed one. (#5560, #5561)

Bug fixes

  • convert_symbol_from_json is strict again: raw strings, lists, and dicts without a $type/type tag raise SerialisationError (restoring pre-kernel validation) instead of being returned unchanged. Constructor-style legacy nodes ({"type": ..., "children": [...]} without name/domains) keep decoding via the class constructor, as the pre-kernel reader did. Decoding a node missing a key its codec requires now raises a descriptive SerialisationError instead of a bare KeyError, and SerialisationError is importable as pybamm.SerialisationError. (#5567)
  • Fixed legacy geometry deserialisation over-stripping the symbol_ key prefix as a character set, which raised KeyError for variable names composed of those characters (e.g. the current-collector variable y). (#5561)
  • Fixed unified experiment mode using excessive memory and time for experiments with many cycles. (#5554)
  • Fixed unified experiment mode inlining every step's equations; switching now dispatches via a casadi.Function.conditional switch. (#5562)

Optimizations

  • Fixed two O(N²) slowdowns in long experiment/ageing simulations where Solution.__add__/copy re-did whole-accumulation work on every step append: time-series validation now re-checks only the joined boundary, and Solution.observable is computed lazily. (#5550)
  • Experiment/ageing accumulation now folds per-cycle solutions in a single O(N) pass via Solution.from_sub_solutions, removing the residual O(N²) list concatenation in repeated Solution.__add__, and fixes an aliasing bug where __add__ mutated the left operand's sensitivities. (#5551)