Skip to content

Commit a53dddd

Browse files
Merge branch 'develop' into feat-eval-at-edge
2 parents 5bdedfe + 3de0d8a commit a53dddd

File tree

20 files changed

+465
-116
lines changed

20 files changed

+465
-116
lines changed

.github/workflows/run_periodic_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ]
33+
os: [ ubuntu-latest, macos-15-intel, macos-latest, windows-latest ]
3434
python-version: ["3.10", "3.11", "3.12"]
3535
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
3636

@@ -48,7 +48,7 @@ jobs:
4848
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng
4949
5050
- name: Install macOS system dependencies
51-
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest'
51+
if: matrix.os == 'macos-15-intel' || matrix.os == 'macos-latest'
5252
env:
5353
HOMEBREW_NO_INSTALL_CLEANUP: 1
5454
HOMEBREW_NO_AUTO_UPDATE: 1

.github/workflows/test_on_push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
51+
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
5252
python-version: ["3.10", "3.11", "3.12"]
5353
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
5454

@@ -74,7 +74,7 @@ jobs:
7474
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng
7575
7676
- name: Install macOS system dependencies
77-
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest'
77+
if: matrix.os == 'macos-15-intel' || matrix.os == 'macos-latest'
7878
env:
7979
HOMEBREW_NO_INSTALL_CLEANUP: 1
8080
HOMEBREW_NO_AUTO_UPDATE: 1

.lycheeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v%7BSUITESPARSE_VERSI
33
https://github.com/LLNL/sundials/releases/download/v%7BSUNDIALS_VERSION%7D/sundials-%7BSUNDIALS_VERSION%7D.tar.gz
44
https://mac.r-project.org/openmp/openmp-%7BOPENMP_VERSION%7D-darwin20-Release.tar.gz
55
https://github.com/pybamm-team/pybamm-data/releases/download/%7Bself.version%7D
6+
https://github.com/pybamm-team/PyBaMM/tree/v%7Brelease_version%7D
67

78
# Errors in docs/source/user_guide/getting_started.md
89
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs

CHANGELOG.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22

33
## Features
44

5+
- Added the `num_steps_no_progress` and `t_no_progress` options in the `IDAKLUSolver` to early terminate the simulation if little progress is detected. ([#5201](https://github.com/pybamm-team/PyBaMM/pull/5201))
56
- Added helper functions to import external 3D meshes in PyBaMM ([#5162](https://github.com/pybamm-team/PyBaMM/pull/5162))
67
- Added support for algebraic and differential surface form in composite models. ([#5165](https://github.com/pybamm-team/PyBaMM/pull/5165))
78
- Adds a composite electrode electrode soh model ([#5160](https://github.com/pybamm-team/PyBaMM/pull/5129))
89
- Generalises `set_initial_soc` to `set_initial_state` and adds Thevenin initial state setting. ([#5129](https://github.com/pybamm-team/PyBaMM/pull/5129))
910

1011
## Bug fixes
1112

13+
- Added explicit warning in installation docs about unmaintained Conda recipe due to pybammsolvers split (Fixes #5155). See pull request [#5206](https://github.com/pybamm-team/PyBaMM/pull/5206)
14+
- Fixed a bug where time-based Heaviside or modulo discontinuities could trigger out-of-bounds errors in time arrays. ([#5205](https://github.com/pybamm-team/PyBaMM/pull/5205))
15+
- Fixed a bug using a time-varying input with heaviside or modulo functions using the `IDAKLUSolver`. ([#4994](https://github.com/pybamm-team/PyBaMM/pull/4994))
1216
- Fix a bug in setting initial stoichiometries where the reference temperature was used instead of the initial temperature. ([#5189](https://github.com/pybamm-team/PyBaMM/pull/5189))
1317
- Fix a bug in the calculation of "Bulk" OCP terms in hysteresis models ([#5169](https://github.com/pybamm-team/PyBaMM/pull/5169))
1418
- Fixed a bug where the final duration of a drive cycle would not be inferred correctly. ([#5153](https://github.com/pybamm-team/PyBaMM/pull/5153))
19+
- Fixes a bug where sensitivities for 1D+ variables calculated using the `output_variables` options were incorrect ([#5118](https://github.com/pybamm-team/PyBaMM/pull/5118))
20+
- 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))
1521

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

24+
1825
## Features
1926

2027
- 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))
@@ -77,7 +84,7 @@
7784

7885
## Breaking changes
7986

80-
- Remove sensitivity functionality for Casadi and Scipy solvers, only `pybamm.IDAKLU` solver can calculate sensitivities. ([#4975](https://github.com/pybamm-team/PyBaMM/pull/4975))
87+
- Remove sensitivity functionality for Casadi and Scipy solvers, only `pybamm.IDAKLUSolver` can calculate sensitivities. ([#4975](https://github.com/pybamm-team/PyBaMM/pull/4975))
8188

8289
# [v25.4.2](https://github.com/pybamm-team/PyBaMM/tree/v25.4.2) - 2025-04-17
8390

@@ -603,7 +610,7 @@ package to install PyBaMM with only the required dependencies. ([conda-forge/pyb
603610
- Removed code for generating `ModelingToolkit` problems ([#2432](https://github.com/pybamm-team/PyBaMM/pull/2432))
604611
- Removed `FirstOrder` and `Composite` lead-acid models, and some submodels specific to those models ([#2431](https://github.com/pybamm-team/PyBaMM/pull/2431))
605612

606-
# [v22.10.post1](https://github.com/pybamm-team/PyBaMM/tree/v22.10.post1) - 2022-10-31
613+
# v22.10.post1 - 2022-10-31
607614

608615
## Breaking changes
609616

@@ -635,7 +642,7 @@ package to install PyBaMM with only the required dependencies. ([conda-forge/pyb
635642
- Removed `get_infinite_nested_dict`, `BaseModel.check_default_variables_dictionaries`, and `Discretisation.create_jacobian` methods, which were not used by any other functionality in the repository ([#2384](https://github.com/pybamm-team/PyBaMM/pull/2384))
636643
- Dropped support for Python 3.7 after the release of Numpy v1.22.0 ([#2379](https://github.com/pybamm-team/PyBaMM/pull/2379))
637644
- Removed parameter cli tools (add/edit/remove parameters). Parameter sets can now more easily be added via python scripts. ([#2342](https://github.com/pybamm-team/PyBaMM/pull/2342))
638-
- Parameter sets should now be provided as single python files containing all parameters and functions. Parameters provided as "data" (e.g. OCP vs SOC) can still be csv files, but must be either in the same folder as the parameter file or in a subfolder called "data/". See for example [Ai2020](https://github.com/pybamm-team/PyBaMM/tree/develop/pybamm/input/parameters/lithium_ion/Ai2020.py) ([#2342](https://github.com/pybamm-team/PyBaMM/pull/2342))
645+
- Parameter sets should now be provided as single python files containing all parameters and functions. Parameters provided as "data" (e.g. OCP vs SOC) can still be csv files, but must be either in the same folder as the parameter file or in a subfolder called "data/". See for example [Ai2020](https://github.com/pybamm-team/PyBaMM/blob/develop/src/pybamm/input/parameters/lithium_ion/Ai2020.py) ([#2342](https://github.com/pybamm-team/PyBaMM/pull/2342))
639646

640647
# [v22.9](https://github.com/pybamm-team/PyBaMM/tree/v22.9) - 2022-09-30
641648

@@ -1339,7 +1346,7 @@ This release introduces many new features and optimizations. All models can now
13391346
- Removed `Outer` and `Kron` nodes as no longer used ([#777](https://github.com/pybamm-team/PyBaMM/pull/777))
13401347
- Moved `results` to separate repositories ([#761](https://github.com/pybamm-team/PyBaMM/pull/761))
13411348
- The parameters "Bruggeman coefficient" must now be specified separately as "Bruggeman coefficient (electrolyte)" and "Bruggeman coefficient (electrode)"
1342-
- The current classes (`GetConstantCurrent`, `GetUserCurrent` and `GetUserData`) have now been removed. Please refer to the [`change-input-current` notebook](https://github.com/pybamm-team/PyBaMM/blob/develop/docs/source/examples/notebooks/change-input-current.ipynb) for information on how to specify an input current
1349+
- The current classes (`GetConstantCurrent`, `GetUserCurrent` and `GetUserData`) have now been removed. Please refer to the [`change-input-current` notebook](https://github.com/pybamm-team/PyBaMM/blob/develop/docs/source/examples/notebooks/parameterization/change-input-current.ipynb) for information on how to specify an input current
13431350
- Parameter functions must now use pybamm functions instead of numpy functions (e.g. `pybamm.exp` instead of `numpy.exp`), as these are then used to construct the expression tree directly. Generally, pybamm syntax follows numpy syntax; please get in touch if a function you need is missing.
13441351
- The current must now be updated by changing "Current function [A]" or "C-rate" instead of "Typical current [A]"
13451352

benchmarks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ asv run v0.3..develop
3232

3333
Further information on how to run benchmarks with `asv` can be found in the documentation at [Using airspeed velocity](https://asv.readthedocs.io/en/stable/using.html).
3434

35-
`asv` is configured using a file `asv.conf.json` located at the root of the PyBaMM repository. See the [asv reference](https://asv.readthedocs.io/en/stable/reference.html) for details on available settings and options.
35+
`asv` is configured using a file `asv.conf.json` located at the root of the PyBaMM repository. See the [asv reference](https://asv.readthedocs.io/en/stable/user_reference.html) for details on available settings and options.
3636

3737
Benchmark results are stored in a directory `results/` at the location of the configuration file. There is one result file per commit, per machine.
3838

docs/source/user_guide/installation/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ It can be installed using ``pip`` or ``conda``, or from source.
2929
3030
conda install -c conda-forge pybamm-base
3131
32+
.. warning::
33+
34+
The PyBaMM Conda recipe is not currently maintained and lags several releases behind.
35+
As a result, installations via Conda will provide an outdated version.
36+
To access the latest version, consider installing PyBaMM using pip.
3237

3338
Optional solvers
3439
----------------
@@ -60,8 +65,8 @@ PyBaMM requires the following dependencies.
6065
=================================================================== ==========================
6166
Package Supported version(s)
6267
=================================================================== ==========================
63-
`PyBaMM solvers <https://github.com/pybamm-team/pybammsolvers>`__ 0.0.4
64-
`NumPy <https://numpy.org>`__ >= 1.23.5, <2
68+
`PyBaMM solvers <https://github.com/pybamm-team/pybammsolvers>`__ >= 0.2.0, <0.4.0
69+
`NumPy <https://numpy.org>`__ Whatever recent versions work
6570
`SciPy <https://docs.scipy.org/doc/scipy/>`__ Whatever recent versions work. >= 1.9.3
6671
`CasADi <https://web.casadi.org/docs/>`__ Whatever recent versions work. >= 3.6.7
6772
`Xarray <https://docs.xarray.dev/en/stable/>`__ Whatever recent versions work. >= 2022.6.0

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ classifiers = [
2828
"Topic :: Scientific/Engineering",
2929
]
3030
dependencies = [
31-
"pybammsolvers",
32-
"numpy>=1.23.5,<2.0.0",
31+
"pybammsolvers>=0.3.0,<0.4.0",
32+
"numpy",
3333
"scipy>=1.11.4",
3434
"casadi==3.6.7",
3535
"xarray>=2022.6.0",
@@ -113,7 +113,7 @@ dev = [
113113
"hypothesis",
114114
]
115115
jax = [
116-
"jax>=0.4.36,<0.6.0",
116+
"jax>=0.4.36,<0.7.0",
117117
]
118118
# Contains all optional dependencies, except for jax, and dev dependencies
119119
all = [

src/pybamm/expression_tree/operations/serialise.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,10 @@ def convert_symbol_to_json(
786786
>>> from pybamm.expression_tree.operations.serialise import Serialise
787787
>>> s = pybamm.Scalar(5)
788788
>>> Serialise.convert_symbol_to_json(s)
789-
{'type': 'Scalar', 'value': 5.0}
790-
789+
{'type': 'Scalar', 'value': np.float64(5.0)}
791790
>>> v = pybamm.Variable("c")
792791
>>> Serialise.convert_symbol_to_json(v)
793-
{'type': 'Variable', 'name': 'c', 'domains': {'primary': [], 'secondary': [], 'tertiary': [], 'quaternary': []}, 'bounds': [{'type': 'Scalar', 'value': -inf}, {'type': 'Scalar', 'value': inf}]}
792+
{'type': 'Variable', 'name': 'c', 'domains': {'primary': [], 'secondary': [], 'tertiary': [], 'quaternary': []}, 'bounds': [{'type': 'Scalar', 'value': np.float64(-inf)}, {'type': 'Scalar', 'value': np.float64(inf)}]}
794793
"""
795794

796795
if isinstance(symbol, numbers.Number | list):

src/pybamm/models/base_model.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import pybamm
1313
from pybamm.expression_tree.operations.serialise import Serialise
1414

15-
# Only throw the default solver warning once
16-
warnings.filterwarnings("once", message="The default solver changed to IDAKLUSolver*")
17-
1815

1916
class BaseModel:
2017
"""
@@ -421,11 +418,6 @@ def default_solver(self):
421418
if len(self.rhs) == 0 and len(self.algebraic) != 0:
422419
return pybamm.CasadiAlgebraicSolver()
423420
else:
424-
warnings.warn(
425-
"The default solver changed to IDAKLUSolver after the v25.4.0. release. "
426-
"You can swap back to the previous default by using `pybamm.CasadiSolver()` instead.",
427-
stacklevel=2,
428-
)
429421
return pybamm.IDAKLUSolver()
430422

431423
@property

src/pybamm/parameters/bpx.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ def bpx_to_param_dict(bpx: BPX) -> dict:
145145
# activity
146146
pybamm_dict["Thermodynamic factor"] = 1.0
147147

148-
# assume Bruggeman relation for effective electrolyte properties
149-
for domain in [negative_electrode, separator, positive_electrode]:
150-
pybamm_dict[domain.pre_name + "Bruggeman coefficient (electrolyte)"] = 1.5
151-
152148
# solid phase properties reported in BPX are already "effective",
153149
# so no correction is applied
154150
for domain in [negative_electrode, positive_electrode]:
@@ -216,10 +212,11 @@ def bpx_to_param_dict(bpx: BPX) -> dict:
216212
pybamm_dict.update({"Total heat transfer coefficient [W.m-2.K-1]": 0})
217213

218214
# transport efficiency
215+
# Compute Bruggeman coefficient from BPX-specified porosity and transport efficiency
219216
for domain in [negative_electrode, separator, positive_electrode]:
220-
pybamm_dict[domain.pre_name + "porosity"] = pybamm_dict[
221-
domain.pre_name + "transport efficiency"
222-
] ** (1.0 / 1.5)
217+
pybamm_dict[domain.pre_name + "Bruggeman coefficient (electrolyte)"] = math.log(
218+
pybamm_dict[domain.pre_name + "transport efficiency"]
219+
) / math.log(pybamm_dict[domain.pre_name + "porosity"])
223220

224221
def _get_activation_energy(var_name):
225222
return pybamm_dict.get(var_name) or 0.0

0 commit comments

Comments
 (0)