Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #4552

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f944df3
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
b9f0faf
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
d1458ab
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
26377a2
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
d27c53b
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
bf08106
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
6de83a5
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
ee33fcf
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
c6ae01f
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
6847934
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
5648348
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
d6ac76e
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
b2e2d7b
Update to Python 3.13
elliotwutingfeng Oct 31, 2024
16db463
Update CHANGELOG.md
elliotwutingfeng Oct 31, 2024
381622e
Revert to Python 3.12 in benchmark_on_push.yml
elliotwutingfeng Oct 31, 2024
468a116
Revert to Python 3.12 in periodic_benchmarks.yml
elliotwutingfeng Oct 31, 2024
11fa051
Revert to Python 3.12 in publish_pypi.yml
elliotwutingfeng Oct 31, 2024
43e202f
Revert to Python 3.12 in run_benchmarks_over_history.yml
elliotwutingfeng Oct 31, 2024
2ea8116
Revert to Python 3.12 in run_periodic_tests.yml
elliotwutingfeng Oct 31, 2024
56b0360
Revert to Python 3.12 in test_on_push.yml
elliotwutingfeng Oct 31, 2024
8f19f65
Revert to Python 3.12 in test_on_push.yml
elliotwutingfeng Oct 31, 2024
13aa1ba
Revert to Python 3.12 in update_version.yml
elliotwutingfeng Oct 31, 2024
c31dd11
Revert to Python 3.12 in .readthedocs.yaml
elliotwutingfeng Oct 31, 2024
4c7769f
Revert to Python 3.12 in test_on_push.yml
elliotwutingfeng Oct 31, 2024
3db7a52
Revert to Python 3.12 in Dockerfile
elliotwutingfeng Oct 31, 2024
b84cb89
Merge branch 'develop' into patch-1
elliotwutingfeng Nov 8, 2024
05cf1b6
Try 0.4.35
elliotwutingfeng Nov 8, 2024
58dceff
Try 0.4.30
elliotwutingfeng Nov 8, 2024
b0d022e
Update util.py to jax 0.4.30
elliotwutingfeng Nov 8, 2024
a987fd6
Use newer jax version for python >= 3.13
elliotwutingfeng Nov 8, 2024
5a5fb82
Update src/pybamm/util.py
elliotwutingfeng Nov 10, 2024
50618c3
Update pyproject.toml
elliotwutingfeng Nov 10, 2024
97869d7
Update noxfile
kratman Nov 15, 2024
7aa4ef0
Merge branch 'develop' of github.com:kratman/PyBaMM into patch-1
kratman Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
elliotwutingfeng marked this conversation as resolved.
Show resolved Hide resolved
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})

steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

- 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))
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/installation/gnu-linux-mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.openblas.net/>`_).
- A C compiler (ex: ``gcc``).
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/installation/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.python.org/downloads/windows/>`__. Make sure to
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -120,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.27",
"jaxlib==0.4.27",
"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'",
elliotwutingfeng marked this conversation as resolved.
Show resolved Hide resolved
]
# For MLIR expression evaluation (IDAKLU Solver)
iree = [
Expand Down
5 changes: 3 additions & 2 deletions src/pybamm/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pathlib
import pickle
import subprocess
import sys
import timeit
import difflib
from warnings import warn
Expand All @@ -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.27"
JAXLIB_VERSION = "0.4.27"
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"
elliotwutingfeng marked this conversation as resolved.
Show resolved Hide resolved


def root_dir():
Expand Down
Loading