Release v26.6.2.0#5617
Closed
BradyPlanden wants to merge 10 commits into
Closed
Conversation
* 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>
* 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)
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This was referenced Jun 16, 2026
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit e5c3cf8)
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
ddb95a4 to
1710492
Compare
Member
Author
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.
Feature release v26.6.2.0, the next feature release in June. Cut per RELEASE.md from
v26.6.1.1rather than branched frommain, becausemaincarries 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 isrelease-base/v26.6.2.0(thev26.6.1.1tag) 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
create_from_bpx/create_from_bpx_objnow apply a BPXStateInitial state-of-charge(validated to[0, 1], blended-electrode aware) instead of ignoring it. Consistent with the already-pinnedbpx>=1.1.0."Contact resistance [Ohm]"can now be a function of the volume-averaged cell temperature, across all thermal options.Bug fixes
RegulariseSqrtAndPowerno longer regularises state-independent bases.load_custom_modelrebuilds the lithium-ionparamfrom restored options; two MSMR option-validation gaps now raise a cleanOptionError.serialise_custom_modelnow records a custom model's discretisation recipe, keeping it discretisable after aBaseModelfallback.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]onmain: 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.