Skip to content

Release v26.6.2.0#5617

Closed
BradyPlanden wants to merge 10 commits into
release-base/v26.6.2.0from
release/v26.6.2.0
Closed

Release v26.6.2.0#5617
BradyPlanden wants to merge 10 commits into
release-base/v26.6.2.0from
release/v26.6.2.0

Conversation

@BradyPlanden

@BradyPlanden BradyPlanden commented Jun 16, 2026

Copy link
Copy Markdown
Member

Feature release v26.6.2.0, the next feature release in June. Cut per RELEASE.md from v26.6.1.1 rather than branched from main, because main carries breaking changes (the "voltage as a state" default flip #5573, and the #5469 bpx-schema note) that are not part of this release. PR base is release-base/v26.6.2.0 (the v26.6.1.1 tag) so the diff is just the cherry-picked non-breaking work plus the version bump, and the test matrix runs on the release branch before tagging.

This supersedes the patch PR #5607 (and its changelog PR #5606): it ships the same non-breaking serialisation fixes and broadens the scope to capture all non-breaking work on main.

Contents (cherry-picked from main, -x)

Features

Bug fixes

Also includes supporting infra fixes with no changelog entry: #5608 (test stability) and #5575 / #5613 (linkcheck/lychee CI).

Excludes the breaking changes that stay in [Unreleased] on main: the "voltage as a state" default flip (#5573) and the #5469 bpx-schema note.

Do not merge this PR. The release is tagged from the branch; merging would duplicate the cherry-picked commits onto the base.

MarcBerliner and others added 7 commits June 15, 2026 15:11
* Fix RegulariseSqrtAndPower corrupting state-independent bases

RegulariseSqrtAndPower replaced every Sqrt/Power node with RegPower,
including bases independent of the state such as pybamm.Parameter and
pybamm.InputParameter rate constants. With the default scale of 1 this
corrupts values below the regularisation tolerance (e.g. a ~1e-9 rate
constant raised to 0.5 evaluated ~470x too small), causing solver
failures or silently wrong overpotentials in user-supplied
exchange-current density functions.

Now only regularise bases that match a registered scale or depend on
the state (variable/state vector/time). State-dependent normalised
bases like (c_e / c_e_ref) ** (1 - alpha) used by built-in sets
(ORegan2022, Chayambuka2022) keep their default-scale regularisation,
and manually-created reg_power nodes (MSMR j0_j) are untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add PR number to changelog entry

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 5946b8c)
* Harden serialisation round-trip tests; fix param-rebuild altitude and MSMR option gaps

Follow-up to the tuple-options fix, addressing issues found while hardening
the serialisation test suite.

Rebuild param at the right altitude. The previous fix rebuilt a loaded
lithium-ion model's `param` with an `isinstance` branch inside
`load_custom_model`. Replace it with a model-owned `_rebuild_param` hook
(no-op on `BaseModel`, overridden by the lithium-ion base model, which now
also uses it in `__init__`). `load_custom_model` calls the hook, so the
options setter stays free of param concerns and the fix lives where the
model owns its derived state (#5598).

Fix two MSMR option-validation gaps surfaced by option fuzzing. Both let an
invalid option set crash later in parameter construction with "invalid
literal for int() with base 10: 'none'" instead of raising a clean
OptionError:
- the all-or-nothing MSMR check missed MSMR inside a per-electrode tuple
  (`("MSMR", "single")`) because it compared the whole value to "MSMR";
- an all-MSMR model left on the default "number of MSMR reactions" ("none")
  passed validation, since the registry only lists that placeholder.

Harden the serialisation test suite:
- generative fuzzing of valid option dicts through to_json/from_json, with
  the construction guard narrowed to (OptionError, NotImplementedError) so
  real bugs surface instead of being silently rejected;
- deterministic tuple-option and int-dimensionality round-trip coverage;
- discretised round-trip now asserts structural identity, solution
  equivalence and event preservation, plus a non-default tuple option.

Co-authored-by: Alec Bills <alexanderallenbills@gmail.com>

* Address review: setter-owned param rebuild, per-electrode MSMR count, symptom assertion

- Move `_rebuild_param` into the `BaseBatteryModel.options` setter so the
  options-derived `param` is kept in sync automatically. Drop the now-redundant
  explicit calls in `lithium_ion.BaseModel.__init__` and `Serialise` deserialise.
  Repurpose the obsolete `test_rebuild_param_syncs_param_with_reassigned_options`
  into `test_options_setter_rebuilds_param`, asserting the new invariant.

- Fix an MSMR regression: validate `number of MSMR reactions` per electrode so a
  mixed cell (MSMR in one electrode, conventional with a "none" count in the
  other) is accepted again, while the genuine all-MSMR "none" default is still
  rejected early. Remove the now-dead `_is_positive_integer_count`; add
  `test_msmr_mixed_electrode_accepted`.

- Strengthen `_assert_param_matches_options` with a symptom-level check: a
  two-phase negative electrode must name its primary active-material fraction
  "Primary: ...", guarding a stale/no-op rebuild beyond the dict comparison.

* fix: MSMR option validation dependent on electrode domains

---------

Co-authored-by: Alec Bills <alexanderallenbills@gmail.com>
(cherry picked from commit 95db690)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Brady Planden <55357039+BradyPlanden@users.noreply.github.com>
* docs: fix dead links breaking linkcheck CI

Two notebook links 404 after the docs site reorganised, failing the
linkChecker job and the Read the Docs linkcheck pre_build step on every
branch:

- source/api/simulation.html -> source/api/simulation/simulation.html
- installation/gnu-linux-mac.html#optional-jaxsolver ->
  installation/index.html#optional-jaxsolver

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: ignore bpxstandard.com in lychee (WAF false positive)

The site is live but its LiteSpeed anti-bot WAF returns 415 to CI/datacenter
IPs, breaking the link checker even though the link is valid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: re-trigger builds (transient GitHub 504s)

No code changes. Earlier failures (lychee, test-data downloads, RTD
sphinx-linkcheck) were all transient github.com 504 Gateway Timeouts on
live links, not real breakages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit cf4ae1e)
* Make "Contact resistance [Ohm]" a function of temperature

Convert the scalar "Contact resistance [Ohm]" parameter into a
FunctionParameter of the volume-averaged cell temperature, which is
available for all thermal options. Existing scalar parameter values
keep working unchanged (auto-wrapped as constants).

Also reframe the documentation: despite the legacy name, this is a
lumped series resistance rather than a true contact resistance
(FaradayInstitution/BPX#130). The name is
kept to avoid a breaking change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Update changelog with PR number

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Clarify contact resistance docs as total series resistance

Reword the docstrings and notebook to explain that "Contact resistance
[Ohm]" really represents the total series resistance of the cell (contact
resistances between layers, tab/weld/lead resistances), keeping the
parameter name. Drop the BPX link and breaking-change motivation from the
docstrings (kept in the changelog).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Clarify series resistance docs per review feedback

Reword "total series resistance of the cell" to "additional series
resistance not already captured by the electrochemical model" so the
description does not read as also including electrolyte/Butler-Volmer
contributions. Fix typos in the notebook, trim verbose option docstring,
and remove the misleading "lumped" qualifier on the default option.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style: pre-commit fixes

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit c8ff7bf)
…#5612)

BPX FloatFunctionTable fields are parsed into placeholder tuples
(name, (x, y)) that must be converted back into pybamm.Interpolant
objects. The conversion targets were a hand-maintained list that was
not updated when #5463/#5507 added the OCP (lithiation)/(delithiation)
branches, so those parameters were left as raw tuples and produced an
unusable ParameterValues.

Replace the per-parameter conversion blocks with a single generic
catch-all that converts any remaining placeholder tuple, and extract a
_table_to_interpolant helper reused across all conversion sites. New
1:1 table parameters now need no hand-maintained list.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 832fa8b)
@BradyPlanden BradyPlanden requested a review from a team as a code owner June 16, 2026 15:48
@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

BradyPlanden and others added 3 commits June 16, 2026 17:05
… lychee (#5613)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit da5064a)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit e5c3cf8)
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.18182% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-base/v26.6.2.0@a9446b0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/pybamm/expression_tree/operations/serialise.py 96.29% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             release-base/v26.6.2.0    #5617   +/-   ##
=========================================================
  Coverage                          ?   98.07%           
=========================================================
  Files                             ?      339           
  Lines                             ?    31817           
  Branches                          ?        0           
=========================================================
  Hits                              ?    31206           
  Misses                            ?      611           
  Partials                          ?        0           

☔ View full report in Codecov by Harness.
📢 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.

@BradyPlanden

Copy link
Copy Markdown
Member Author

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.

4 participants