Skip to content

Commit 3144907

Browse files
authored
Deprecate python 3.9 support (#5052)
* Remove python 3.9 * Pre-commit changes * pre-commit * Update changelog * Fix some docs * Update src/pybamm/discretisations/discretisation.py
1 parent 563c100 commit 3144907

74 files changed

Lines changed: 241 additions & 202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run_periodic_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
os: [ ubuntu-latest, macos-13, macos-14, windows-latest ]
34-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
34+
python-version: ["3.10", "3.11", "3.12"]
3535
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
3636

3737
steps:

.github/workflows/test_on_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
fail-fast: false
5050
matrix:
5151
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
52-
python-version: ["3.9", "3.10", "3.11", "3.12"]
52+
python-version: ["3.10", "3.11", "3.12"]
5353
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
5454

5555
steps:

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
- Generalise `pybamm.DiscreteTimeSum` to allow it to be embedded in other expressions ([#5044](https://github.com/pybamm-team/PyBaMM/pull/5044))
66

7-
## Optimizations
8-
97
## Bug fixes
108

119
- Converts sensitivities to numpy objects, fixing bug in `DiscreteTimeSum` sensitivity calculation ([#5037](https://github.com/pybamm-team/PyBaMM/pull/5037))
1210

13-
1411
## Breaking changes
1512

13+
- Removed support for Python 3.9 ([#5052](https://github.com/pybamm-team/PyBaMM/pull/5052))
14+
1615
# [v25.6.0](https://github.com/pybamm-team/PyBaMM/tree/v25.6.0) - 2025-05-27
1716

1817
## Features

docs/source/examples/notebooks/batch_study.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
"# changing the value of \"Current function [A]\" in all the parameter values present in the\n",
201201
"# parameter_values dictionary\n",
202202
"for _, v, current_value in zip(\n",
203-
" parameter_values.keys(), parameter_values.values(), current_values\n",
203+
" parameter_values.keys(), parameter_values.values(), current_values, strict=False\n",
204204
"):\n",
205205
" v[\"Current function [A]\"] = current_value\n",
206206
"\n",
@@ -506,7 +506,7 @@
506506
"\n",
507507
"# updating the value of \"SEI open-circuit potential [V]\" in all the dictionary items\n",
508508
"for _, v, sei_oc_v in zip(\n",
509-
" parameter_values.keys(), parameter_values.values(), sei_oc_v_values\n",
509+
" parameter_values.keys(), parameter_values.values(), sei_oc_v_values, strict=False\n",
510510
"):\n",
511511
" v.update(\n",
512512
" {\"SEI open-circuit potential [V]\": sei_oc_v},\n",

docs/source/examples/notebooks/models/graded-electrodes.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"\n",
106106
"experiment = pybamm.Experiment([\"Discharge at 3C until 2.5 V\"])\n",
107107
"\n",
108-
"for eps_n, eps_p in zip(eps_ns, eps_ps):\n",
108+
"for eps_n, eps_p in zip(eps_ns, eps_ps, strict=False):\n",
109109
" parameter_values[\"Negative electrode porosity\"] = eps_n\n",
110110
" parameter_values[\"Positive electrode porosity\"] = eps_p\n",
111111
" sim = pybamm.Simulation(\n",

docs/source/examples/notebooks/models/lithium-plating-composite.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@
498498
"\n",
499499
" fig, axs = plt.subplots(2, 2, figsize=(13, 9))\n",
500500
" ax2 = axs[1, 1].twinx() # Create a secondary y-axis\n",
501-
" for (C_rate, sim), color in zip(sims.items(), colors):\n",
501+
" for (C_rate, sim), color in zip(sims.items(), colors, strict=False):\n",
502502
" # Isolate final equilibration phase\n",
503503
" sol = sim.solution.cycles[0].steps[2]\n",
504504
"\n",
@@ -509,7 +509,7 @@
509509
" axs[0, 0].plot(t, V, color=color, linestyle=\"solid\", label=C_rate)\n",
510510
"\n",
511511
" # Currents\n",
512-
" for current, ls in zip(currents, linestyles):\n",
512+
" for current, ls in zip(currents, linestyles, strict=False):\n",
513513
" j = sol[current].entries\n",
514514
" axs[0, 1].plot(t, j, color=color, linestyle=ls)\n",
515515
"\n",

docs/source/examples/notebooks/models/lithium-plating.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
" import matplotlib.pyplot as plt\n",
195195
"\n",
196196
" fig, axs = plt.subplots(2, 2, figsize=(13, 9))\n",
197-
" for (C_rate, sim), color in zip(sims.items(), colors):\n",
197+
" for (C_rate, sim), color in zip(sims.items(), colors, strict=False):\n",
198198
" # Isolate final equilibration phase\n",
199199
" sol = sim.solution.cycles[0].steps[2]\n",
200200
"\n",
@@ -205,7 +205,7 @@
205205
" axs[0, 0].plot(t, V, color=color, linestyle=\"solid\", label=C_rate)\n",
206206
"\n",
207207
" # Currents\n",
208-
" for current, ls in zip(currents, linestyles):\n",
208+
" for current, ls in zip(currents, linestyles, strict=False):\n",
209209
" j = sol[current].entries\n",
210210
" axs[0, 1].plot(t, j, color=color, linestyle=ls)\n",
211211
"\n",

docs/source/examples/notebooks/models/sodium-ion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"source": [
121121
"import matplotlib.pyplot as plt\n",
122122
"\n",
123-
"for solution, C_rate in zip(solutions, C_rates):\n",
123+
"for solution, C_rate in zip(solutions, C_rates, strict=False):\n",
124124
" capacity = [i * 1000 for i in solution[\"Discharge capacity [A.h]\"].entries]\n",
125125
" voltage = solution[\"Voltage [V]\"].entries\n",
126126
" plt.plot(capacity, voltage, label=f\"{(12 * C_rate)} A.m-2\")\n",

docs/source/examples/notebooks/models/thermal-models.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
"params = [full_params, lumped_params]\n",
449449
"# loop over the models and solve\n",
450450
"sols = []\n",
451-
"for model, param in zip(models, params):\n",
451+
"for model, param in zip(models, params, strict=False):\n",
452452
" param[\"Current function [A]\"] = 3 * 0.68\n",
453453
" sim = pybamm.Simulation(model, parameter_values=param)\n",
454454
" sim.solve([0, 3600])\n",
@@ -552,7 +552,7 @@
552552
"source": [
553553
"params = [lumped_params, lumped_params_contact_resistance]\n",
554554
"sols = []\n",
555-
"for model, param in zip(models, params):\n",
555+
"for model, param in zip(models, params, strict=False):\n",
556556
" sim = pybamm.Simulation(model, parameter_values=param)\n",
557557
" sim.solve([0, 3600])\n",
558558
" sols.append(sim.solution)"

docs/source/examples/notebooks/solvers/idaklu-jax-interface.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"source": [
99
"# IDAKLU-JAX interface\n",
1010
"\n",
11-
"The IDAKLU-JAX interface requires that PyBaMM is installed with the [optional JAX solver enabled](https://docs.pybamm.org/en/stable/source/user_guide/installation/gnu-linux-mac.html#optional-jaxsolver) (`pip install pybamm[jax]`) and requires at least Python 3.9.\n",
11+
"The IDAKLU-JAX interface requires that PyBaMM is installed with the [optional JAX solver enabled](https://docs.pybamm.org/en/stable/source/user_guide/installation/gnu-linux-mac.html#optional-jaxsolver) (`pip install pybamm[jax]`) and requires at least Python 3.10.\n",
1212
"\n",
1313
"PyBaMM provides two mechanisms to interface battery models with JAX. The first (JaxSolver) implements PyBaMM models directly in native JAX, and as such provides the greatest flexibility. However, these models can be very slow to compile, especially during their initial run, and can require large amounts of memory.\n",
1414
"\n",

0 commit comments

Comments
 (0)