Skip to content

Commit efd426c

Browse files
Merge pull request #2497 from pybamm-team/develop
Make release v22.11
2 parents c544b6d + c17756f commit efd426c

File tree

238 files changed

+20990
-4963
lines changed

Some content is hidden

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

238 files changed

+20990
-4963
lines changed

.all-contributorsrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@
528528
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
529529
"profile": "https://github.com/agriyakhetarpal",
530530
"contributions": [
531-
"infra"
531+
"infra",
532+
"code"
532533
]
533534
},
534535
{

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
!CMakeLists.txt
1414
!pybamm/CITATIONS.txt
1515
!pybamm/input/**/*.csv
16+
!tests/unit/test_parameters/*.csv
1617
!benchmarks/benchmark_images/*.png
1718

1819
# running files

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/mirrors-prettier
7-
rev: v3.0.0-alpha.3
7+
rev: v3.0.0-alpha.4
88
hooks:
99
- id: prettier
1010
exclude: assets/js/webapp\.js
@@ -15,6 +15,6 @@ repos:
1515
- id: black
1616

1717
- repo: https://github.com/PyCQA/flake8
18-
rev: 5.0.4
18+
rev: 6.0.0
1919
hooks:
2020
- id: flake8

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
11
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)
22

3+
# [v22.11](https://github.com/pybamm-team/PyBaMM/tree/v22.11) - 2022-11-30
4+
5+
## Features
6+
7+
- Updated parameter sets so that interpolants are created explicitly in the parameter set python file. This does not change functionality but allows finer control, e.g. specifying a "cubic" interpolator instead of the default "linear" ([#2510](https://github.com/pybamm-team/PyBaMM/pull/2510))
8+
- Equivalent circuit models ([#2478](https://github.com/pybamm-team/PyBaMM/pull/2478))
9+
- New Idaklu solver options for jacobian type and linear solver, support Sundials v6 ([#2444](https://github.com/pybamm-team/PyBaMM/pull/2444))
10+
- Added `scale` and `reference` attributes to `Variable` objects, which can be use to make the ODE/DAE solver better conditioned ([#2440](https://github.com/pybamm-team/PyBaMM/pull/2440))
11+
- SEI reactions can now be asymmetric ([#2425](https://github.com/pybamm-team/PyBaMM/pull/2425))
12+
13+
## Bug fixes
14+
15+
- Switched from `pkg_resources` to `importlib_metadata` for handling entry points ([#2500](https://github.com/pybamm-team/PyBaMM/pull/2500))
16+
- Fixed some bugs related to processing `FunctionParameter` to `Interpolant` ([#2494](https://github.com/pybamm-team/PyBaMM/pull/2494))
17+
18+
## Optimizations
19+
20+
- `ParameterValues` now avoids trying to process children if a function parameter is an object that doesn't depend on its children ([#2477](https://github.com/pybamm-team/PyBaMM/pull/2477))
21+
- Implemented memoization via `cache` and `cached_property` from functools ([#2465](https://github.com/pybamm-team/PyBaMM/pull/2465))
22+
- Added more rules for simplifying expressions, especially around Concatenations. Also, meshes constructed from multiple domains are now cached ([#2443](https://github.com/pybamm-team/PyBaMM/pull/2443))
23+
- Added more rules for simplifying expressions. Constants in binary operators are now moved to the left by default (e.g. `x*2` returns `2*x`) ([#2424](https://github.com/pybamm-team/PyBaMM/pull/2424))
24+
25+
## Breaking changes
26+
27+
- Interpolants created from parameter data are now "linear" by default (was "cubic") ([#2494](https://github.com/pybamm-team/PyBaMM/pull/2494))
28+
- Renamed entry point for parameter sets to `pybamm_parameter_sets` ([#2475](https://github.com/pybamm-team/PyBaMM/pull/2475))
29+
- Removed code for generating `ModelingToolkit` problems ([#2432](https://github.com/pybamm-team/PyBaMM/pull/2432))
30+
- Removed `FirstOrder` and `Composite` lead-acid models, and some submodels specific to those models ([#2431](https://github.com/pybamm-team/PyBaMM/pull/2431))
31+
332
# [v22.10.post1](https://github.com/pybamm-team/PyBaMM/tree/v22.10.post1) - 2022-10-31
433

34+
## Breaking changes
35+
536
- Removed all julia generation code ([#2453](https://github.com/pybamm-team/PyBaMM/pull/2453)). Julia code will be hosted at [PyBaMM.jl](https://github.com/tinosulzer/PyBaMM.jl) from now on.
637

738
# [v22.10](https://github.com/pybamm-team/PyBaMM/tree/v22.10) - 2022-10-31
839

940
## Features
1041

11-
- Third-party parameter sets can be added by registering entry points to `pybamm_parameter_set` ([#2396](https://github.com/pybamm-team/PyBaMM/pull/2396))
42+
- Third-party parameter sets can be added by registering entry points to ~~`pybamm_parameter_set`~~`pybamm_parameter_sets` ([#2396](https://github.com/pybamm-team/PyBaMM/pull/2396), changed in [#2475](https://github.com/pybamm-team/PyBaMM/pull/2475))
1243
- Added three-dimensional interpolation ([#2380](https://github.com/pybamm-team/PyBaMM/pull/2380))
1344

1445
## Bug fixes

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ keywords:
2424
- "expression tree"
2525
- "python"
2626
- "symbolic differentiation"
27-
version: "22.10"
27+
version: "22.11"
2828
repository-code: "https://github.com/pybamm-team/PyBaMM"
2929
title: "Python Battery Mathematical Modelling (PyBaMM)"

CMakeBuild.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ def run(self):
8282
use_python_casadi = False
8383
else:
8484
use_python_casadi = True
85+
86+
build_type = os.getenv("PYBAMM_CPP_BUILD_TYPE", "RELEASE")
8587
cmake_args = [
88+
"-DCMAKE_BUILD_TYPE={}".format(build_type),
8689
"-DPYTHON_EXECUTABLE={}".format(sys.executable),
8790
"-DUSE_PYTHON_CASADI={}".format("TRUE" if use_python_casadi else "FALSE"),
8891
]

CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,20 @@ endif()
3535

3636
add_subdirectory(${PYBIND11_DIR})
3737
pybind11_add_module(idaklu
38-
pybamm/solvers/c_solvers/idaklu_python.cpp
39-
pybamm/solvers/c_solvers/idaklu_python.hpp
38+
pybamm/solvers/c_solvers/idaklu/casadi_functions.cpp
39+
pybamm/solvers/c_solvers/idaklu/casadi_functions.hpp
40+
pybamm/solvers/c_solvers/idaklu/casadi_solver.cpp
41+
pybamm/solvers/c_solvers/idaklu/casadi_solver.hpp
42+
pybamm/solvers/c_solvers/idaklu/casadi_sundials_functions.hpp
43+
pybamm/solvers/c_solvers/idaklu/casadi_sundials_functions.cpp
44+
pybamm/solvers/c_solvers/idaklu/common.hpp
45+
pybamm/solvers/c_solvers/idaklu/python.hpp
46+
pybamm/solvers/c_solvers/idaklu/python.cpp
47+
pybamm/solvers/c_solvers/idaklu/solution.cpp
48+
pybamm/solvers/c_solvers/idaklu/solution.hpp
49+
pybamm/solvers/c_solvers/idaklu/options.hpp
50+
pybamm/solvers/c_solvers/idaklu/options.cpp
4051
pybamm/solvers/c_solvers/idaklu.cpp
41-
pybamm/solvers/c_solvers/idaklu.hpp
42-
pybamm/solvers/c_solvers/idaklu_casadi.cpp
43-
pybamm/solvers/c_solvers/idaklu_casadi.hpp
44-
pybamm/solvers/c_solvers/solution.cpp
45-
pybamm/solvers/c_solvers/solution.hpp
4652
)
4753

4854
if (NOT DEFINED USE_PYTHON_CASADI)

FindSUNDIALS.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#
99
# * sundials_ida
1010
# * sundials_sunlinsolklu
11+
# * sundials_sunlinsoldense
12+
# * sundials_sunlinsollapackdense
1113
# * sundials_sunmatrix_sparse
1214
# * sundials_nvecserial
1315
#
@@ -31,6 +33,9 @@ find_path(SUNDIALS_INCLUDE_DIR
3133
sundials/sundials_math.h
3234
sundials/sundials_types.h
3335
sunlinsol/sunlinsol_klu.h
36+
sunlinsol/sunlinsol_dense.h
37+
sunlinsol/sunlinsol_spbcgs.h
38+
sunlinsol/sunlinsol_lapackdense.h
3439
sunmatrix/sunmatrix_sparse.h
3540
PATH_SUFFIXES
3641
include
@@ -41,6 +46,9 @@ find_path(SUNDIALS_INCLUDE_DIR
4146
set(SUNDIALS_WANT_COMPONENTS
4247
sundials_idas
4348
sundials_sunlinsolklu
49+
sundials_sunlinsoldense
50+
sundials_sunlinsolspbcgs
51+
sundials_sunlinsollapackdense
4452
sundials_sunmatrixsparse
4553
sundials_nvecserial
4654
)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ Additional supporting material can be found
6868

6969
Note that the examples on the default `develop` branch are tested on the latest `develop` commit. This may sometimes cause errors when running the examples on the pybamm pip package, which is synced to the `main` branch. You can switch to the `main` branch on github to see the version of the examples that is compatible with the latest pip release.
7070

71-
<!-- For further examples, see the list of repositories that use PyBaMM [here](https://github.com/pybamm-team/pybamm-example-results). -->
71+
## Versioning
72+
73+
PyBaMM uses [CalVer](https://calver.org/), which means that we make new releases every month with the version number `YY.MM`. There is no difference between releases that increment the year and releases that increment the month; in particular, releases that increment the month may introduce breaking changes. Breaking changes for each release are communicated via the [CHANGELOG](CHANGELOG.md), and come with deprecation warnings or errors that are kept for at least one year (12 releases). If you find a breaking change that is not documented, or think it should be undone, please open an issue on [GitHub](https://github.com/pybamm-team/pybamm).
7274

7375
## 🚀 Installing PyBaMM
7476

@@ -214,7 +216,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
214216
<td align="center"><a href="https://github.com/ndrewwang"><img src="https://avatars.githubusercontent.com/u/56122552?v=4?s=100" width="100px;" alt="ndrewwang"/><br /><sub><b>ndrewwang</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Andrewwang" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=ndrewwang" title="Code">💻</a></td>
215217
<td align="center"><a href="https://github.com/MichaPhilipp"><img src="https://avatars.githubusercontent.com/u/58085966?v=4?s=100" width="100px;" alt="MichaPhilipp"/><br /><sub><b>MichaPhilipp</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3AMichaPhilipp" title="Bug reports">🐛</a></td>
216218
<td align="center"><a href="https://github.com/abillscmu"><img src="https://avatars.githubusercontent.com/u/48105066?v=4?s=100" width="100px;" alt="Alec Bills"/><br /><sub><b>Alec Bills</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=abillscmu" title="Code">💻</a></td>
217-
<td align="center"><a href="https://github.com/agriyakhetarpal"><img src="https://avatars.githubusercontent.com/u/74401230?v=4?s=100" width="100px;" alt="Agriya Khetarpal"/><br /><sub><b>Agriya Khetarpal</b></sub></a><br /><a href="#infra-agriyakhetarpal" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
219+
<td align="center"><a href="https://github.com/agriyakhetarpal"><img src="https://avatars.githubusercontent.com/u/74401230?v=4?s=100" width="100px;" alt="Agriya Khetarpal"/><br /><sub><b>Agriya Khetarpal</b></sub></a><br /><a href="#infra-agriyakhetarpal" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=agriyakhetarpal" title="Code">💻</a></td>
218220
<td align="center"><a href="https://github.com/awadell1"><img src="https://avatars.githubusercontent.com/u/5857298?v=4?s=100" width="100px;" alt="Alex Wadell"/><br /><sub><b>Alex Wadell</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Tests">⚠️</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Documentation">📖</a></td>
219221
</tr>
220222
</tbody>

benchmarks/different_model_options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ class TimeBuildModelSEI:
124124
"none",
125125
"constant",
126126
"reaction limited",
127+
"reaction limited (asymmetric)",
127128
"solvent-diffusion limited",
128129
"electron-migration limited",
129130
"interstitial-diffusion limited",
130131
"ec reaction limited",
132+
"ec reaction limited (asymmetric)",
131133
],
132134
)
133135

@@ -143,10 +145,12 @@ class TimeSolveSEI:
143145
"none",
144146
"constant",
145147
"reaction limited",
148+
"reaction limited (asymmetric)",
146149
"solvent-diffusion limited",
147150
"electron-migration limited",
148151
"interstitial-diffusion limited",
149152
"ec reaction limited",
153+
"ec reaction limited (asymmetric)",
150154
],
151155
)
152156

0 commit comments

Comments
 (0)