Skip to content

Commit eda4ebe

Browse files
Merge branch 'develop' into roundtrip-serialisation-fix
2 parents d24a728 + 1319b4a commit eda4ebe

File tree

9 files changed

+24
-6
lines changed

9 files changed

+24
-6
lines changed

.github/workflows/benchmark_on_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
enable-cache: true
4141

4242
- name: Install python dependencies
43-
run: uv pip install asv[virtualenv]
43+
run: uv pip install --system asv
4444

4545
- name: Fetch base branch
4646
run: |

.github/workflows/periodic_benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
enable-cache: true
4949

5050
- name: Install python dependencies
51-
run: uv pip install asv[virtualenv]
51+
run: uv pip install --system asv
5252

5353
- name: Run benchmarks
5454
run: |

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)
22

3+
## Features
4+
5+
## Bug fixes
6+
7+
- Fix a bug with serialising `InputParameter`s. ([#5289](https://github.com/pybamm-team/PyBaMM/pull/5289))
8+
9+
# [v25.10.1](https://github.com/pybamm-team/PyBaMM/tree/v25.10.1) - 2025-11-14
10+
311
## Features
412
- Allow setting initial conditions from `y_slices` of a `Solution` object. ([#5257](https://github.com/pybamm-team/PyBaMM/pull/5257))
513
- Added docstring to `FuzzyDict.copy` explaining its return value and behavior. ([#5242](https://github.com/pybamm-team/PyBaMM/pull/5242))

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ keywords:
2424
- "expression tree"
2525
- "python"
2626
- "symbolic differentiation"
27-
version: "25.10.0"
27+
version: "25.10.1"
2828
repository-code: "https://github.com/pybamm-team/PyBaMM"
2929
title: "Python Battery Mathematical Modelling (PyBaMM)"

docs/source/examples/notebooks/creating_models/4-comparing-full-and-reduced-order-models.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"$$\n",
2525
"\\left.c\\right\\vert_{t=0} = c_0,\n",
2626
"$$\n",
27-
"where $c$$ is the concentration, $r$ the radial coordinate, $t$ time, $R$ the particle radius, $D$ the diffusion coefficient, $j$ the interfacial current density, $F$ Faraday's constant, and $c_0$ the initial concentration. \n",
27+
"where $c$ is the concentration, $r$ the radial coordinate, $t$ time, $R$ the particle radius, $D$ the diffusion coefficient, $j$ the interfacial current density, $F$ Faraday's constant, and $c_0$ the initial concentration. \n",
2828
"\n",
2929
"As in the previous example we use the following parameters:\n",
3030
"\n",

src/pybamm/expression_tree/operations/serialise.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,8 @@ def convert_symbol_from_json(json_data):
16251625
elif json_data["type"] == "Parameter":
16261626
# Convert stored parameters back to PyBaMM Parameter objects
16271627
return pybamm.Parameter(json_data["name"])
1628+
elif json_data["type"] == "InputParameter":
1629+
return pybamm.InputParameter(json_data["name"])
16281630
elif json_data["type"] == "Scalar":
16291631
# Convert stored numerical values back to PyBaMM Scalar objects
16301632
return pybamm.Scalar(json_data["value"])

src/pybamm/models/submodels/interface/kinetics/butler_volmer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SymmetricButlerVolmer(BaseKinetics):
1212
Submodel which implements the symmetric forward Butler-Volmer equation:
1313
1414
.. math::
15-
j = 2 * j_0(c) * \\sinh(ne * F * \\eta_r(c) / RT)
15+
j = 2 * j_0(c) * \\sinh(ne * F * \\eta_r(c) / 2RT)
1616
1717
Parameters
1818
----------

src/pybamm/models/submodels/interface/open_circuit_potential/base_hysteresis_ocp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _get_coupled_variables(self, variables):
8484
U_eq = self.phase_param.U(sto_surf, T)
8585
U_eq_x_av = self.phase_param.U(sto_surf, T)
8686
U_lith = self.phase_param.U(sto_surf, T, "lithiation")
87-
U_lith_bulk = self.phase_param.U(sto_bulk, T_bulk)
87+
U_lith_bulk = self.phase_param.U(sto_bulk, T_bulk, "lithiation")
8888
U_delith = self.phase_param.U(sto_surf, T, "delithiation")
8989
U_delith_bulk = self.phase_param.U(sto_bulk, T_bulk, "delithiation")
9090

tests/unit/test_serialisation/test_serialisation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,14 @@ def test_serialise_time(self):
617617
t2 = convert_symbol_from_json(j)
618618
assert isinstance(t2, pybamm.Time)
619619

620+
def test_serialise_input_parameter(self):
621+
"""Test InputParameter serialization and deserialization."""
622+
ip = pybamm.InputParameter("test_param")
623+
j = convert_symbol_to_json(ip)
624+
ip_restored = convert_symbol_from_json(j)
625+
assert isinstance(ip_restored, pybamm.InputParameter)
626+
assert ip_restored.name == "test_param"
627+
620628
def test_convert_symbol_to_json_with_number_and_list(self):
621629
for val in (0, 3.14, -7, True):
622630
out = convert_symbol_to_json(val)

0 commit comments

Comments
 (0)