From f944df33afa8745d1f6c5ce10e1483207296c489 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 10:54:29 +0800 Subject: [PATCH 01/32] Update to Python 3.13 --- scripts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index e6fac122ff..5684e6d289 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim-bullseye +FROM python:3.13-slim-bullseye COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv WORKDIR / From b9f0faf5164ac9617689c08f005bf023965ded99 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 10:59:46 +0800 Subject: [PATCH 02/32] Update to Python 3.13 --- docs/source/user_guide/installation/gnu-linux-mac.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/user_guide/installation/gnu-linux-mac.rst b/docs/source/user_guide/installation/gnu-linux-mac.rst index 97171b53b7..421597e1fd 100644 --- a/docs/source/user_guide/installation/gnu-linux-mac.rst +++ b/docs/source/user_guide/installation/gnu-linux-mac.rst @@ -6,7 +6,7 @@ GNU/Linux & macOS Prerequisites ------------- -To use PyBaMM, you must have Python 3.9, 3.10, 3.11, or 3.12 installed. +To use PyBaMM, you must have Python 3.9, 3.10, 3.11, 3.12, or 3.13 installed. .. tab:: Debian-based distributions (Debian, Ubuntu) @@ -43,7 +43,7 @@ User install We recommend to install PyBaMM within a virtual environment, in order not to alter any distribution Python files. -First, make sure you are using Python 3.9, 3.10, 3.11, or 3.12. +First, make sure you are using Python 3.9, 3.10, 3.11, 3.12, or 3.13. To create a virtual environment ``env`` within your current directory type: .. code:: bash From d1458aba51d8a049af336e425d07274a3ccb4818 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:06:47 +0800 Subject: [PATCH 03/32] Update to Python 3.13 --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ae6a74a5cf..b99d232f7d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -19,7 +19,7 @@ build: - "graphviz" os: ubuntu-22.04 tools: - python: "3.12" + python: "3.13" jobs: # Unshallow the git clone otherwise this may cause issues with Sphinx extensions post_checkout: From 26377a2ec1c9e0d4b505d37963526f8a68c592c9 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:07:24 +0800 Subject: [PATCH 04/32] Update to Python 3.13 --- docs/source/user_guide/installation/install-from-source.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_guide/installation/install-from-source.rst b/docs/source/user_guide/installation/install-from-source.rst index ea664b4a5b..62e698d6a6 100644 --- a/docs/source/user_guide/installation/install-from-source.rst +++ b/docs/source/user_guide/installation/install-from-source.rst @@ -25,7 +25,7 @@ or download the source archive on the repository's homepage. To install PyBaMM, you will need: -- Python 3 (PyBaMM supports versions 3.9, 3.10, 3.11, and 3.12) +- Python 3 (PyBaMM supports versions 3.9, 3.10, 3.11, 3.12, and 3.13) - The Python headers file for your current Python version. - A BLAS library (for instance `openblas `_). - A C compiler (ex: ``gcc``). From d27c53bd8c5e664803125b9a3932d9907a17f2af Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:09:43 +0800 Subject: [PATCH 05/32] Update to Python 3.13 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1db7c927a3..de5506305a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", ] dependencies = [ From bf0810645177c6acc54c22d355223af9322f8bdd Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:10:17 +0800 Subject: [PATCH 06/32] Update to Python 3.13 --- docs/source/user_guide/installation/windows.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 44dc79a7d3..1bb5f80d27 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -6,7 +6,7 @@ Windows Prerequisites ------------- -To use PyBaMM, you must have Python 3.9, 3.10, 3.11, or 3.12 installed. +To use PyBaMM, you must have Python 3.9, 3.10, 3.11, 3.12, or 3.13 installed. To install Python 3 download the installation files from `Python’s website `__. Make sure to From 6de83a5836a485fc0be4c4fe7b933c882742cd5b Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:10:43 +0800 Subject: [PATCH 07/32] Update to Python 3.13 --- .github/workflows/update_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_version.yml b/.github/workflows/update_version.yml index 899667d2de..015b348aa1 100644 --- a/.github/workflows/update_version.yml +++ b/.github/workflows/update_version.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install dependencies run: | From ee33fcfd3a6a8e44dcc99c935866118a8d16e759 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:11:10 +0800 Subject: [PATCH 08/32] Update to Python 3.13 --- .github/workflows/benchmark_on_push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index 2883eb5f26..c0319ef02c 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install Linux system dependencies run: | From c6ae01f690f78911939f061dbc8f368445b55c00 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:11:44 +0800 Subject: [PATCH 09/32] Update to Python 3.13 --- .github/workflows/periodic_benchmarks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index 14f97c55d8..6d2aa0be52 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install Linux system dependencies run: | @@ -63,10 +63,10 @@ jobs: needs: benchmarks runs-on: ubuntu-latest steps: - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install asv run: pip install asv From 684793419921b278e4a60ffdd4e88291699c06c8 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:12:11 +0800 Subject: [PATCH 10/32] Update to Python 3.13 --- .github/workflows/run_benchmarks_over_history.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_benchmarks_over_history.yml b/.github/workflows/run_benchmarks_over_history.yml index d66704a635..043e0c7ce5 100644 --- a/.github/workflows/run_benchmarks_over_history.yml +++ b/.github/workflows/run_benchmarks_over_history.yml @@ -23,10 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install nox and asv run: pip install -U pip nox asv @@ -58,10 +58,10 @@ jobs: needs: benchmarks runs-on: ubuntu-latest steps: - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install asv run: pip install asv From 56483484a9ae20cb26649ad089c1ae49cbf639c4 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:12:34 +0800 Subject: [PATCH 11/32] Update to Python 3.13 --- .github/workflows/publish_pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 89c9b057c1..b35a0d572c 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -275,7 +275,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Build SDist run: pipx run build --sdist From d6ac76e2c213970a0afec7b0b4c94bcfbe86e98c Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:16:01 +0800 Subject: [PATCH 12/32] Update to Python 3.13 --- .github/workflows/test_on_push.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index 32e3017446..a31016b7f5 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Set up uv run: python -m pip install uv @@ -42,7 +42,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-13, macos-14, windows-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }}) steps: @@ -114,15 +114,15 @@ jobs: run: python -m nox -s pybamm-requires - name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' + if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.13' run: python -m nox -s unit - name: Run coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' run: python -m nox -s coverage - name: Upload coverage report - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -181,7 +181,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - name: Example notebooks (ubuntu-latest / Python 3.12) + name: Example notebooks (ubuntu-latest / Python 3.13) steps: - name: Check out PyBaMM repository @@ -200,11 +200,11 @@ jobs: sudo dot -c sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.12 + - name: Set up Python 3.13 id: setup-python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 cache: 'pip' - name: Set up uv @@ -229,7 +229,7 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example notebooks tests for GNU/Linux with Python 3.12 + - name: Run example notebooks tests for GNU/Linux with Python 3.13 run: python -m nox -s examples run_scripts_tests: @@ -237,7 +237,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - name: Example scripts (ubuntu-latest / Python 3.12) + name: Example scripts (ubuntu-latest / Python 3.13) steps: - name: Check out PyBaMM repository @@ -256,11 +256,11 @@ jobs: sudo dot -c sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.12 + - name: Set up Python 3.13 id: setup-python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 cache: 'pip' - name: Set up uv @@ -285,5 +285,5 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example scripts tests for GNU/Linux with Python 3.12 + - name: Run example scripts tests for GNU/Linux with Python 3.13 run: python -m nox -s scripts From b2e2d7b0e52436c0dc162116ebbaa3afa757c505 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:17:31 +0800 Subject: [PATCH 13/32] Update to Python 3.13 --- .github/workflows/run_periodic_tests.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run_periodic_tests.yml b/.github/workflows/run_periodic_tests.yml index 6e86de054e..85f05a50f8 100644 --- a/.github/workflows/run_periodic_tests.yml +++ b/.github/workflows/run_periodic_tests.yml @@ -32,7 +32,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-13, macos-14, windows-latest ] - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }}) steps: @@ -80,15 +80,15 @@ jobs: run: python -m nox -s pybamm-requires - name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' + if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.13' run: python -m nox -s unit - name: Run coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' run: python -m nox -s coverage - name: Upload coverage report - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -131,7 +131,7 @@ jobs: run_example_tests: runs-on: ubuntu-latest - name: Example notebooks (ubuntu-latest / Python 3.12) + name: Example notebooks (ubuntu-latest / Python 3.13) steps: - name: Check out PyBaMM repository @@ -142,10 +142,10 @@ jobs: sudo apt-get update sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Set up uv run: python -m pip install uv @@ -157,12 +157,12 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example notebooks tests for GNU/Linux with Python 3.12 + - name: Run example notebooks tests for GNU/Linux with Python 3.13 run: python -m nox -s examples run_scripts_tests: runs-on: ubuntu-latest - name: Example scripts (ubuntu-latest / Python 3.12) + name: Example scripts (ubuntu-latest / Python 3.13) steps: - name: Check out PyBaMM repository @@ -173,10 +173,10 @@ jobs: sudo apt-get update sudo apt install gfortran gcc graphviz libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Set up uv run: python -m pip install uv @@ -188,5 +188,5 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example scripts tests for GNU/Linux with Python 3.12 + - name: Run example scripts tests for GNU/Linux with Python 3.13 run: python -m nox -s scripts From 16db46364024ea375c0e2b5a7beb2046f095dfa2 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 31 Oct 2024 11:22:26 +0800 Subject: [PATCH 14/32] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9167391c10..1db3f43a12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- Added support for Python 3.13 (#4552) - Adds support to `pybamm.Experiment` for the `output_variables` option in the `IDAKLUSolver`. ([#4534](https://github.com/pybamm-team/PyBaMM/pull/4534)) - Adds an option "voltage as a state" that can be "false" (default) or "true". If "true" adds an explicit algebraic equation for the voltage. ([#4507](https://github.com/pybamm-team/PyBaMM/pull/4507)) - Improved `QuickPlot` accuracy for simulations with Hermite interpolation. ([#4483](https://github.com/pybamm-team/PyBaMM/pull/4483)) From 381622e71904327d0dc1d20847a4ead4f51f0f07 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:26:10 +0800 Subject: [PATCH 15/32] Revert to Python 3.12 in benchmark_on_push.yml --- .github/workflows/benchmark_on_push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index c0319ef02c..2883eb5f26 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install Linux system dependencies run: | From 468a1169980bb8473eff052cc1de352092279dfa Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:26:51 +0800 Subject: [PATCH 16/32] Revert to Python 3.12 in periodic_benchmarks.yml --- .github/workflows/periodic_benchmarks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index 6d2aa0be52..14f97c55d8 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install Linux system dependencies run: | @@ -63,10 +63,10 @@ jobs: needs: benchmarks runs-on: ubuntu-latest steps: - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install asv run: pip install asv From 11fa05148e4274cbaffbc9e97ccd08b5e646a2dd Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:27:36 +0800 Subject: [PATCH 17/32] Revert to Python 3.12 in publish_pypi.yml --- .github/workflows/publish_pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index b35a0d572c..89c9b057c1 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -275,7 +275,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Build SDist run: pipx run build --sdist From 43e202f5dc71d82e72ac800414a74e053e27b045 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:28:26 +0800 Subject: [PATCH 18/32] Revert to Python 3.12 in run_benchmarks_over_history.yml --- .github/workflows/run_benchmarks_over_history.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_benchmarks_over_history.yml b/.github/workflows/run_benchmarks_over_history.yml index 043e0c7ce5..d66704a635 100644 --- a/.github/workflows/run_benchmarks_over_history.yml +++ b/.github/workflows/run_benchmarks_over_history.yml @@ -23,10 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install nox and asv run: pip install -U pip nox asv @@ -58,10 +58,10 @@ jobs: needs: benchmarks runs-on: ubuntu-latest steps: - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install asv run: pip install asv From 2ea8116e2e3694b0ae71ddcccc5dcd2514de02d3 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:37:32 +0800 Subject: [PATCH 19/32] Revert to Python 3.12 in run_periodic_tests.yml --- .github/workflows/run_periodic_tests.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run_periodic_tests.yml b/.github/workflows/run_periodic_tests.yml index 85f05a50f8..d6d87fa3e3 100644 --- a/.github/workflows/run_periodic_tests.yml +++ b/.github/workflows/run_periodic_tests.yml @@ -131,7 +131,7 @@ jobs: run_example_tests: runs-on: ubuntu-latest - name: Example notebooks (ubuntu-latest / Python 3.13) + name: Example notebooks (ubuntu-latest / Python 3.12) steps: - name: Check out PyBaMM repository @@ -142,10 +142,10 @@ jobs: sudo apt-get update sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Set up uv run: python -m pip install uv @@ -157,12 +157,12 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example notebooks tests for GNU/Linux with Python 3.13 + - name: Run example notebooks tests for GNU/Linux with Python 3.12 run: python -m nox -s examples run_scripts_tests: runs-on: ubuntu-latest - name: Example scripts (ubuntu-latest / Python 3.13) + name: Example scripts (ubuntu-latest / Python 3.12) steps: - name: Check out PyBaMM repository @@ -173,10 +173,10 @@ jobs: sudo apt-get update sudo apt install gfortran gcc graphviz libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.13 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Set up uv run: python -m pip install uv @@ -188,5 +188,5 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example scripts tests for GNU/Linux with Python 3.13 + - name: Run example scripts tests for GNU/Linux with Python 3.12 run: python -m nox -s scripts From 56b0360f5e4892c85bca75d4ab9cc062e16081df Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:41:01 +0800 Subject: [PATCH 20/32] Revert to Python 3.12 in test_on_push.yml --- .github/workflows/test_on_push.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index a31016b7f5..92e9cf008a 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -200,11 +200,11 @@ jobs: sudo dot -c sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.13 + - name: Set up Python 3.12 id: setup-python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 cache: 'pip' - name: Set up uv @@ -229,7 +229,7 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example notebooks tests for GNU/Linux with Python 3.13 + - name: Run example notebooks tests for GNU/Linux with Python 3.12 run: python -m nox -s examples run_scripts_tests: @@ -237,7 +237,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - name: Example scripts (ubuntu-latest / Python 3.13) + name: Example scripts (ubuntu-latest / Python 3.12) steps: - name: Check out PyBaMM repository @@ -256,11 +256,11 @@ jobs: sudo dot -c sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - - name: Set up Python 3.13 + - name: Set up Python 3.12 id: setup-python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 cache: 'pip' - name: Set up uv @@ -285,5 +285,5 @@ jobs: timeout-minutes: 10 run: python -m nox -s pybamm-requires - - name: Run example scripts tests for GNU/Linux with Python 3.13 + - name: Run example scripts tests for GNU/Linux with Python 3.12 run: python -m nox -s scripts From 8f19f650be9518430ba08198c844bc5e36f2f4ba Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:42:13 +0800 Subject: [PATCH 21/32] Revert to Python 3.12 in test_on_push.yml --- .github/workflows/test_on_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index 92e9cf008a..a82ec2c5e3 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -181,7 +181,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - name: Example notebooks (ubuntu-latest / Python 3.13) + name: Example notebooks (ubuntu-latest / Python 3.12) steps: - name: Check out PyBaMM repository From 13aa1ba2dc87ea6add97cf8e345e7c11a923aa03 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:43:44 +0800 Subject: [PATCH 22/32] Revert to Python 3.12 in update_version.yml --- .github/workflows/update_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_version.yml b/.github/workflows/update_version.yml index 015b348aa1..899667d2de 100644 --- a/.github/workflows/update_version.yml +++ b/.github/workflows/update_version.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Install dependencies run: | From c31dd114e839cc2a2550342691e20bcbdb10495c Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:44:33 +0800 Subject: [PATCH 23/32] Revert to Python 3.12 in .readthedocs.yaml --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b99d232f7d..ae6a74a5cf 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -19,7 +19,7 @@ build: - "graphviz" os: ubuntu-22.04 tools: - python: "3.13" + python: "3.12" jobs: # Unshallow the git clone otherwise this may cause issues with Sphinx extensions post_checkout: From 4c7769f620b5c0c88c59f292e5ac338f82b8026a Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:46:07 +0800 Subject: [PATCH 24/32] Revert to Python 3.12 in test_on_push.yml --- .github/workflows/test_on_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index a82ec2c5e3..ca54c560a7 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.12 - name: Set up uv run: python -m pip install uv From 3db7a529a99565d40580874a7e2f78f6b5a8db6b Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 1 Nov 2024 00:47:28 +0800 Subject: [PATCH 25/32] Revert to Python 3.12 in Dockerfile --- scripts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 5684e6d289..e6fac122ff 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13-slim-bullseye +FROM python:3.12-slim-bullseye COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv WORKDIR / From 05cf1b610815c693f971c3a4f73298eef46bf156 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 8 Nov 2024 21:35:45 +0800 Subject: [PATCH 26/32] Try 0.4.35 --- .github/workflows/run_periodic_tests.yml | 6 +++--- .github/workflows/test_on_push.yml | 6 +++--- CHANGELOG.md | 2 +- pyproject.toml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_periodic_tests.yml b/.github/workflows/run_periodic_tests.yml index d6d87fa3e3..6edaf09ebf 100644 --- a/.github/workflows/run_periodic_tests.yml +++ b/.github/workflows/run_periodic_tests.yml @@ -80,15 +80,15 @@ jobs: run: python -m nox -s pybamm-requires - name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.13' + if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' run: python -m nox -s unit - name: Run coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' run: python -m nox -s coverage - name: Upload coverage report - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index ca54c560a7..0cedac8e5d 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -114,15 +114,15 @@ jobs: run: python -m nox -s pybamm-requires - name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.13' + if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' run: python -m nox -s unit - name: Run coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' run: python -m nox -s coverage - name: Upload coverage report - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1db3f43a12..dc02cda43a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Features -- Added support for Python 3.13 (#4552) +- Added support for Python 3.13 ([#4552](https://github.com/pybamm-team/PyBaMM/pull/4552)) - Adds support to `pybamm.Experiment` for the `output_variables` option in the `IDAKLUSolver`. ([#4534](https://github.com/pybamm-team/PyBaMM/pull/4534)) - Adds an option "voltage as a state" that can be "false" (default) or "true". If "true" adds an explicit algebraic equation for the voltage. ([#4507](https://github.com/pybamm-team/PyBaMM/pull/4507)) - Improved `QuickPlot` accuracy for simulations with Hermite interpolation. ([#4483](https://github.com/pybamm-team/PyBaMM/pull/4483)) diff --git a/pyproject.toml b/pyproject.toml index de5506305a..8ae0e2e05a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,8 +121,8 @@ dev = [ # Note: These must be kept in sync with the versions defined in pybamm/util.py, and # must remain compatible with IREE (see noxfile.py for IREE compatibility). jax = [ - "jax==0.4.27", - "jaxlib==0.4.27", + "jax==0.4.35", + "jaxlib==0.4.35", ] # For MLIR expression evaluation (IDAKLU Solver) iree = [ From 58dceff4e2227ade8edc13a15213173ba4124405 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 8 Nov 2024 21:38:39 +0800 Subject: [PATCH 27/32] Try 0.4.30 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8ae0e2e05a..d619476157 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,8 +121,8 @@ dev = [ # Note: These must be kept in sync with the versions defined in pybamm/util.py, and # must remain compatible with IREE (see noxfile.py for IREE compatibility). jax = [ - "jax==0.4.35", - "jaxlib==0.4.35", + "jax==0.4.30", + "jaxlib==0.4.30", ] # For MLIR expression evaluation (IDAKLU Solver) iree = [ From b0d022e4bac523c636f43157bceb959d03921c0c Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 8 Nov 2024 21:50:14 +0800 Subject: [PATCH 28/32] Update util.py to jax 0.4.30 --- src/pybamm/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybamm/util.py b/src/pybamm/util.py index 5b10b23fcb..e536d7fd09 100644 --- a/src/pybamm/util.py +++ b/src/pybamm/util.py @@ -13,8 +13,8 @@ # Versions of jax and jaxlib compatible with PyBaMM. Note: these are also defined in # the extras dependencies in pyproject.toml, and therefore must be kept in sync. -JAX_VERSION = "0.4.27" -JAXLIB_VERSION = "0.4.27" +JAX_VERSION = "0.4.30" +JAXLIB_VERSION = "0.4.30" def root_dir(): From a987fd66cb52f5c8e4136fd247d0e3efb0e170b0 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Fri, 8 Nov 2024 21:59:26 +0800 Subject: [PATCH 29/32] Use newer jax version for python >= 3.13 --- pyproject.toml | 6 ++++-- src/pybamm/util.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d619476157..a47240b97b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,8 +121,10 @@ dev = [ # Note: These must be kept in sync with the versions defined in pybamm/util.py, and # must remain compatible with IREE (see noxfile.py for IREE compatibility). jax = [ - "jax==0.4.30", - "jaxlib==0.4.30", + "jax==0.4.27; python_version <'3.13'", + "jaxlib==0.4.27; python_version <'3.13'", + "jax==0.4.34; python_version >='3.13'", + "jaxlib==0.4.34; python_version >='3.13'", ] # For MLIR expression evaluation (IDAKLU Solver) iree = [ diff --git a/src/pybamm/util.py b/src/pybamm/util.py index e536d7fd09..6afe3f7d66 100644 --- a/src/pybamm/util.py +++ b/src/pybamm/util.py @@ -5,6 +5,7 @@ import pathlib import pickle import subprocess +import sys import timeit import difflib from warnings import warn @@ -13,8 +14,8 @@ # Versions of jax and jaxlib compatible with PyBaMM. Note: these are also defined in # the extras dependencies in pyproject.toml, and therefore must be kept in sync. -JAX_VERSION = "0.4.30" -JAXLIB_VERSION = "0.4.30" +JAX_VERSION = "0.4.34" if sys.version_info.minor >= 13 else "0.4.27" +JAXLIB_VERSION = "0.4.34" if sys.version_info.minor >= 13 else "0.4.27" def root_dir(): From 5a5fb82d07f4393942037fc3e580cefebbcd3421 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Mon, 11 Nov 2024 06:31:31 +0800 Subject: [PATCH 30/32] Update src/pybamm/util.py Co-authored-by: Eric G. Kratz --- src/pybamm/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybamm/util.py b/src/pybamm/util.py index 6afe3f7d66..52740cd501 100644 --- a/src/pybamm/util.py +++ b/src/pybamm/util.py @@ -14,8 +14,8 @@ # Versions of jax and jaxlib compatible with PyBaMM. Note: these are also defined in # the extras dependencies in pyproject.toml, and therefore must be kept in sync. -JAX_VERSION = "0.4.34" if sys.version_info.minor >= 13 else "0.4.27" -JAXLIB_VERSION = "0.4.34" if sys.version_info.minor >= 13 else "0.4.27" +JAX_VERSION = "0.4.27" if sys.version_info < (3, 10) else "0.4.34" +JAXLIB_VERSION = "0.4.27" if sys.version_info < (3, 10) else "0.4.34" def root_dir(): From 50618c3117e43d520e336332ad6ebd168001c48e Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Mon, 11 Nov 2024 06:31:48 +0800 Subject: [PATCH 31/32] Update pyproject.toml Co-authored-by: Eric G. Kratz --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a47240b97b..e7fc62b4b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,10 +121,10 @@ dev = [ # Note: These must be kept in sync with the versions defined in pybamm/util.py, and # must remain compatible with IREE (see noxfile.py for IREE compatibility). jax = [ - "jax==0.4.27; python_version <'3.13'", - "jaxlib==0.4.27; python_version <'3.13'", - "jax==0.4.34; python_version >='3.13'", - "jaxlib==0.4.34; python_version >='3.13'", + "jax==0.4.27; python_version <'3.10'", + "jaxlib==0.4.27; python_version <'3.10'", + "jax==0.4.34; python_version >='3.10'", + "jaxlib==0.4.34; python_version >='3.10'", ] # For MLIR expression evaluation (IDAKLU Solver) iree = [ From 97869d78a0f3b70de17203d2ffa90f5bb7d28c7a Mon Sep 17 00:00:00 2001 From: kratman Date: Fri, 15 Nov 2024 16:56:17 -0500 Subject: [PATCH 32/32] Update noxfile --- noxfile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 5ab32f463f..4a41a50140 100644 --- a/noxfile.py +++ b/noxfile.py @@ -34,7 +34,16 @@ def set_iree_state(): ), stacklevel=2, ) - return "OFF" + state = "OFF" + if sys.version_info >= (3, 13): + warnings.warn( + ( + "IREE is not available for Python 3.13 or higher. " + "Setting PYBAMM_IDAKLU_EXPR_IREE=OFF." + ), + stacklevel=2, + ) + state = "OFF" return state