Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- PyBaMM and `pybammsolvers` now develop in a single repository — a UV workspace under `packages/` — while continuing to release independently to PyPI. Release tags are namespaced (`pybamm-v*` and `pybammsolvers-v*`), and PyBaMM's CI now tests against the in-repo solver on every platform. The published `pybamm` package and its dependency on `pybammsolvers` are unchanged for users. See `RELEASE.md` for the release model. ([#5512](https://github.com/pybamm-team/PyBaMM/issues/5512))
- Legacy BPX v0.x files/objects now load again: `bpx` itself detects and converts them to the v1.x schema on a best-effort basis (with a `UserWarning`), so `ParameterValues.create_from_bpx`/`create_from_bpx_obj` no longer raise a `ValidationError`. PyBaMM officially supports `bpx>=1`. ([#5574](https://github.com/pybamm-team/PyBaMM/pull/5574))
- `create_from_bpx`/`create_from_bpx_obj` now also accept BPX files that omit `State` fields (or the whole `State` section): the ambient/initial temperatures default to the reference temperature and the initial electrolyte concentration to 1000 mol.m-3 (logged), while opt-in fields (initial hysteresis state, heat transfer coefficient) are left for the model to default. ([#5574](https://github.com/pybamm-team/PyBaMM/pull/5574))
- add `pybamm.LossSolver` that constructs a loss function from a `pybamm.Simulation` [(#5625)](https://github.com/pybamm-team/PyBaMM/pull/5652)

## Bug fixes

Expand Down Expand Up @@ -245,6 +246,7 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
- Fixed a bug in 2D concatenatations for quantities that vary in the `tb` direction ([#5310](https://github.com/pybamm-team/PyBaMM/pull/5310))

# Breaking changes

- Removes default constants added to `ParameterValues` on construction. **Only breaking if you rely on this functionality in custom models, parameters, etc.** ([#5336](https://github.com/pybamm-team/PyBaMM/pull/5336))

# [v25.10.2](https://github.com/pybamm-team/PyBaMM/tree/v25.10.2) - 2025-11-27
Expand Down Expand Up @@ -296,12 +298,12 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
- Fix Bruggeman coefficient computation from BPX porosity and transport efficiency instead of hard-coding, remove redundant values, and add a unit test for verification. ([#5196](https://github.com/pybamm-team/PyBaMM/pull/5196))

## Breaking changes

- Updates the hysteresis decay rate parameters to a "true" hysteresis decay rate which changes the interpretation of the units of the hysteresis decay rate parameters. ([#5217](https://github.com/pybamm-team/PyBaMM/pull/5217))
- Changed fundamental variable for all SEI models from thickness to concentration ([#4869](https://github.com/pybamm-team/PyBaMM/pull/4869))

# [v25.8.0](https://github.com/pybamm-team/PyBaMM/tree/v25.8.0) - 2025-08-04


## Features

- Added `plot_3d_cross_section` & `plot_3d_heatmap` functions to support plotting for 3D thermal simulations. ([#5130](https://github.com/pybamm-team/PyBaMM/pull/5130))
Expand All @@ -326,7 +328,7 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
- Fixed non-deterministic plotting CI issues ([#5150](https://github.com/pybamm-team/PyBaMM/pull/5150))
- Fix non-deterministic ShapeError in 3D FEM gradient method ([#5143](https://github.com/pybamm-team/PyBaMM/pull/5143))
- Fixes negative electrode boundary values for half-cell voltage contributions. ([#5139](https://github.com/pybamm-team/PyBaMM/pull/5139))
- Makes `A_cc` L_z * L_y * number of layers ([#5138](https://github.com/pybamm-team/PyBaMM/pull/5138))
- Makes `A_cc` L_z *L_y* number of layers ([#5138](https://github.com/pybamm-team/PyBaMM/pull/5138))
- Fixes `TimeIntegral` expression node summation when dependent on an input parameter. ([#5119](https://github.com/pybamm-team/PyBaMM/pull/5119))
- Fixed a bug that ignored the default duration of drive cycles for `CRate` steps and a bug that overwrote custom `period` arguments for drive cycles. ([#5090](https://github.com/pybamm-team/PyBaMM/pull/5090))
- Converts sensitivities to numpy objects, fixing bug in `DiscreteTimeSum` sensitivity calculation ([#5037](https://github.com/pybamm-team/PyBaMM/pull/5037))
Expand All @@ -335,7 +337,6 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
- Fixed a bug where simplifications cause heavisides to evaluate as booleans ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))
- Fixed a bug in the `WyciskOpenCircuitPotential` model where the differential capacity was not being evaluated correctly. ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))


## Breaking changes

- Changed behavior of drive cycle steps in `pybamm.Experiment`s to treat each time point as a discontinuity, consistent with how input interpolants work. This ensures more accurate simulation of drive cycles with rapid changes. ([#5141](https://github.com/pybamm-team/PyBaMM/pull/5141))
Expand All @@ -344,7 +345,6 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
- Removed support for Python 3.9 ([#5052](https://github.com/pybamm-team/PyBaMM/pull/5052))
- In OCP hysteresis models, users need to explicitly give the equilibrium, delithiation, and lithiation OCPs when using a hysteresis model. E.g., you must provide all three of "Negative electrode OCP [V]", "Negative electrode delithiation OCP [V]", and "Negative electrode lithiation OCP [V]". ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))


# [v25.6.0](https://github.com/pybamm-team/PyBaMM/tree/v25.6.0) - 2025-05-27

## Features
Expand Down Expand Up @@ -502,6 +502,7 @@ package to install PyBaMM with only the required dependencies. ([conda-forge/pyb
- Removed the `start_step_offset` setting and disabled minimum `dt` warnings for drive cycles with the (`IDAKLUSolver`). ([#4416](https://github.com/pybamm-team/PyBaMM/pull/4416))

## Bug Fixes

- Added error for binary operators on two concatenations with different numbers of children. Previously, the extra children were dropped. Also fixed bug where Q_rxn was dropped from the total heating term in half-cell models. ([#4562](https://github.com/pybamm-team/PyBaMM/pull/4562))
- Fixed bug where Q_rxn was set to 0 for the negative electrode in half-cell models. ([#4557](https://github.com/pybamm-team/PyBaMM/pull/4557))
- Fixed bug in post-processing solutions with infeasible experiments using the (`IDAKLUSolver`). ([#4541](https://github.com/pybamm-team/PyBaMM/pull/4541))
Expand Down Expand Up @@ -1269,7 +1270,7 @@ This release introduces:
- Added `NewmanTobias` li-ion battery model ([#1423](https://github.com/pybamm-team/PyBaMM/pull/1423))
- Added `plot_voltage_components` to easily plot the component overpotentials that make up the voltage ([#1419](https://github.com/pybamm-team/PyBaMM/pull/1419))
- Made `QuickPlot` more customizable and added an example ([#1419](https://github.com/pybamm-team/PyBaMM/pull/1419))
- `Solution` objects can now be created by stepping _different_ models ([#1408](https://github.com/pybamm-team/PyBaMM/pull/1408))
- `Solution` objects can now be created by stepping *different* models ([#1408](https://github.com/pybamm-team/PyBaMM/pull/1408))
- Added Yang et al 2017 model that couples irreversible lithium plating, SEI growth and change in porosity which produces a transition from linear to nonlinear degradation pattern of lithium-ion battery over extended cycles([#1398](https://github.com/pybamm-team/PyBaMM/pull/1398))
- Added support for Python 3.9 and dropped support for Python 3.6. Python 3.6 may still work but is now untested ([#1370](https://github.com/pybamm-team/PyBaMM/pull/1370))
- Added the electrolyte overpotential and Ohmic losses for full conductivity, including surface form ([#1350](https://github.com/pybamm-team/PyBaMM/pull/1350))
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def install_locked(session, *, extras=None, groups=None):
def run_coverage(session):
"""Run the coverage tests and generate an XML report."""
set_environment_variables(PYBAMM_ENV, session=session)
install_locked(session, extras=["all", "jax"], groups=["dev"])
install_locked(session, extras=["all", "jax", "pydiffsol"], groups=["dev"])
# Using plugin here since coverage runs unit tests on linux with latest python version.
if "CI" in os.environ:
session.install("pytest-github-actions-annotate-failures")
Expand Down Expand Up @@ -147,7 +147,7 @@ def run_doctests(session):
def run_unit(session):
"""Run the unit tests."""
set_environment_variables(PYBAMM_ENV, session=session)
install_locked(session, extras=["all", "jax"], groups=["dev"])
install_locked(session, extras=["all", "jax", "pydiffsol"], groups=["dev"])
session.run("python", "-m", "pytest", "-m", "unit", "packages/pybamm/tests")


Expand Down
170 changes: 90 additions & 80 deletions packages/pybamm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ maintainers = [{ name = "The PyBaMM Team", email = "pybamm@pybamm.org" }]
requires-python = ">=3.10, <3.15"
readme = { file = "README.md", content-type = "text/markdown" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
]
dependencies = [
"pybammsolvers>=0.8.0,<0.9.0",
Expand Down Expand Up @@ -53,66 +53,68 @@ Changelog = "https://github.com/pybamm-team/PyBaMM/blob/main/CHANGELOG.md"
# For example notebooks
examples = ["jupyter"]
plot = [
# Note: matplotlib is loaded for debug plots, but to ensure PyBaMM runs
# on systems without an attached display, it should never be imported
# outside of plot() methods.
"matplotlib>=3.6.0",
# Note: matplotlib is loaded for debug plots, but to ensure PyBaMM runs
# on systems without an attached display, it should never be imported
# outside of plot() methods.
"matplotlib>=3.6.0",
]
cite = ["pybtex>=0.25.0"]
# For diffsl export integration tests
pydiffsol = ["pydiffsol>=0.5.2"]
# For diffsl tests
pydiffsol = ["pydiffsol>=0.6.1"]
# Battery Parameter eXchange format
bpx = ["bpx>=1.1.1,<1.2.0"]
# Low-overhead progress bars
tqdm = ["tqdm"]
jax = ["jax>=0.7.0, <0.9.0; python_version >= '3.11' and (sys_platform != 'darwin' or platform_machine != 'x86_64')"]
jax = [
"jax>=0.7.0, <0.9.0; python_version >= '3.11' and (sys_platform != 'darwin' or platform_machine != 'x86_64')",
]
# Contains all optional dependencies, except for jax, and dev dependencies
all = [
"scikit-fem>=8.1.0",
"meshio>=5.3.0",
"pybamm[examples,plot,cite,bpx,tqdm]",
"scikit-fem>=8.1.0",
"meshio>=5.3.0",
"pybamm[examples,plot,cite,bpx,tqdm]",
]

[dependency-groups]
docs = [
"sphinx>=6",
"sphinx_rtd_theme>=0.5",
"pydata-sphinx-theme",
"sphinx_design",
"sphinx-copybutton",
"myst-parser",
"sphinx-inline-tabs",
"sphinxcontrib-bibtex",
"sphinx-autobuild",
"sphinx-last-updated-by-git",
"nbsphinx",
"ipykernel",
"ipywidgets",
"sphinx-gallery",
"sphinx-docsearch",
"sphinx>=6",
"sphinx_rtd_theme>=0.5",
"pydata-sphinx-theme",
"sphinx_design",
"sphinx-copybutton",
"myst-parser",
"sphinx-inline-tabs",
"sphinxcontrib-bibtex",
"sphinx-autobuild",
"sphinx-last-updated-by-git",
"nbsphinx",
"ipykernel",
"ipywidgets",
"sphinx-gallery",
"sphinx-docsearch",
]
dev = [
# For working with pre-commit hooks
"pre-commit",
# For code style checks: linting and auto-formatting
"ruff",
# For running testing sessions
"nox",
# For coverage
"pytest-cov",
# For doctest
"pytest-doctestplus",
# pytest and its plugins
"pytest>=9.0",
"pytest-xdist",
"pytest-mock",
"pytest-snapshot",
# For testing Jupyter notebooks
"nbmake",
# To access the metadata for python packages
"importlib-metadata; python_version < '3.10'",
# For property based testing
"hypothesis",
# For working with pre-commit hooks
"pre-commit",
# For code style checks: linting and auto-formatting
"ruff",
# For running testing sessions
"nox",
# For coverage
"pytest-cov",
# For doctest
"pytest-doctestplus",
# pytest and its plugins
"pytest>=9.0",
"pytest-xdist",
"pytest-mock",
"pytest-snapshot",
# For testing Jupyter notebooks
"nbmake",
# To access the metadata for python packages
"importlib-metadata; python_version < '3.10'",
# For property based testing
"hypothesis",
]

[project.entry-points."pybamm_parameter_sets"]
Expand Down Expand Up @@ -159,21 +161,29 @@ build.hooks.vcs.version-file = "src/pybamm/_version.py"
# pyproject. Without this, setuptools_scm looks for .git in packages/pybamm/,
# fails, and falls back to 0.0.0.
root = "../.."
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "pybamm-v*"]
git_describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"pybamm-v*",
]
tag_regex = '^pybamm-v(?P<version>[0-9].*)$'

[tool.repo-review]
ignore = [
"MY", # ignore all MyPy setting checks (MY101, MY103, MY104, MY105, MY106)
"PP004", # ignore the check that prevents an upper cap on Python requires
"PP308", # ignore the explicit pytest summary flag (-ra) check
"PC140", # ignore missing type checker in pre-commit
"PC160", # ignore missing spell checker in pre-commit
"PC180", # ignore missing markdown formatter in pre-commit
"RF102", # ignore the missing isort selection in Ruff configuration
"PP006", # ignore dev dependency group should be defined
"NOX201", # ignore set a script block with dependencies in your noxfile
"NOX202", # ignore noxfile has a shebang line
"MY", # ignore all MyPy setting checks (MY101, MY103, MY104, MY105, MY106)
"PP004", # ignore the check that prevents an upper cap on Python requires
"PP308", # ignore the explicit pytest summary flag (-ra) check
"PC140", # ignore missing type checker in pre-commit
"PC160", # ignore missing spell checker in pre-commit
"PC180", # ignore missing markdown formatter in pre-commit
"RF102", # ignore the missing isort selection in Ruff configuration
"PP006", # ignore dev dependency group should be defined
"NOX201", # ignore set a script block with dependencies in your noxfile
"NOX202", # ignore noxfile has a shebang line
]

# NOTE: The shared [tool.ruff] config was hoisted to the repo-root pyproject.toml
Expand All @@ -188,14 +198,14 @@ testpaths = ["tests"]
console_output_style = "progress"
xfail_strict = true
filterwarnings = [
"error",
# ignore internal nbmake warnings
'ignore:unclosed \<socket.socket:ResourceWarning',
'ignore:unclosed event loop \<:ResourceWarning',
# ignore warnings generated while running tests
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::RuntimeWarning",
"error",
# ignore internal nbmake warnings
'ignore:unclosed \<socket.socket:ResourceWarning',
'ignore:unclosed event loop \<:ResourceWarning',
# ignore warnings generated while running tests
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::RuntimeWarning",
]

# Logging configuration
Expand All @@ -218,7 +228,7 @@ disable_error_code = ["call-overload", "operator"]

[[tool.mypy.overrides]]
module = [
"pybamm.models.base_model.*",
"pybamm.models.full_battery_models.base_battery_model.*",
"pybamm.models.base_model.*",
"pybamm.models.full_battery_models.base_battery_model.*",
]
disable_error_code = "attr-defined"
Loading
Loading