Skip to content

Commit

Permalink
#1129 merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Aug 31, 2021
2 parents 1237c16 + bce4eaa commit ebb5d3f
Show file tree
Hide file tree
Showing 170 changed files with 6,338 additions and 949 deletions.
19 changes: 19 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,25 @@
"code",
"test"
]
},
{
"login": "chuckliu1979",
"name": "Chuck Liu",
"avatar_url": "https://avatars.githubusercontent.com/u/13491954?v=4",
"profile": "https://github.com/chuckliu1979",
"contributions": [
"bug",
"code"
]
},
{
"login": "partben",
"name": "partben",
"avatar_url": "https://avatars.githubusercontent.com/u/88316576?v=4",
"profile": "https://github.com/partben",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- pybamm/parameters_cli.py
- pybamm/install_odes.py
1 change: 1 addition & 0 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev graphviz
sudo apt install texlive-full
Expand Down
25 changes: 20 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM)
# [v21.08](https://github.com/pybamm-team/PyBaMM/tree/v21.08) - 2021-08-26

This release introduces:
- the switch to calendar versioning: from now on we will use year.month version number
- sensitivity analysis of solutions with respect to input parameters
- several new models, including many-particle and state-of-health models
- improvement on how CasADI solver's handle events, including a new "fast with events" mode
- several other new features, optimizations, and bug fixes, summarized below

## Features

- Addes UDDS and WLTC drive cycles ([#1601](https://github.com/pybamm-team/PyBaMM/pull/1601))
- Added submodels and functionality for particle-size distributions in the DFN model, including an
example notebook ([#1602](https://github.com/pybamm-team/PyBaMM/pull/1602))
- Added UDDS and WLTC drive cycles ([#1601](https://github.com/pybamm-team/PyBaMM/pull/1601))
- Added LG M50 (NMC811 and graphite + SiOx) parameter set from O'Regan 2021 ([#1594](https://github.com/pybamm-team/PyBaMM/pull/1594))
- `pybamm.base_solver.solve` function can take a list of input parameters to calculate the sensitivities of the solution with respect to. Alternatively, it can be set to `True` to calculate the sensitivities for all input parameters ([#1552](https://github.com/pybamm-team/PyBaMM/pull/1552))
- Added capability for `quaternary` domains (in addition to `primary`, `secondary` and `tertiary`), increasing the maximum number of domains that a `Symbol` can have to 4. ([#1580](https://github.com/pybamm-team/PyBaMM/pull/1580))
- Tabs can now be placed at the bottom of the cell in 1+1D thermal models ([#1581](https://github.com/pybamm-team/PyBaMM/pull/1581))
- Added temperature dependence on electrode electronic conductivity ([#1570](https://github.com/pybamm-team/PyBaMM/pull/1570))
- `pybamm.base_solver.solve` function can take a list of input parameters to calculate the sensitivities of the solution with respect to. Alternatively, it can be set to `True` to calculate the sensitivities for all input parameters ([#1552](https://github.com/pybamm-team/PyBaMM/pull/1552))
- Added a new lithium-ion model `MPM` or Many-Particle Model, with a distribution of particle sizes in each electrode. ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
- Added 2 new submodels for lithium transport in a size distribution of electrode particles: Fickian diffusion (`FickianSingleSizeDistribution`) and uniform concentration profile (`FastSingleSizeDistribution`). ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
- Added a "particle size" domain to the default lithium-ion geometry, including plotting capabilities (`QuickPlot`) and processing of variables (`ProcessedVariable`). ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
Expand Down Expand Up @@ -34,14 +46,18 @@

## Bug fixes

- Updated documentation to include some previously missing functions, such as `erf` and `tanh` ([#1628](https://github.com/pybamm-team/PyBaMM/pull/1628))
- Fixed reading citation file without closing ([#1620](https://github.com/pybamm-team/PyBaMM/pull/1620))
- Porosity variation for SEI and plating models is calculated from the film thickness rather than from a separate ODE ([#1617](https://github.com/pybamm-team/PyBaMM/pull/1617))
- Fixed a bug where the order of the indexing for the entries of variables discretised using FEM was incorrect ([#1556](https://github.com/pybamm-team/PyBaMM/pull/1556))
- Fix broken module import for spyder when running a script twice ([#1555](https://github.com/pybamm-team/PyBaMM/pull/1555))
- Fixed ElectrodeSOH model for multi-dimensional simulations ([#1548](https://github.com/pybamm-team/PyBaMM/pull/1548))
- Removed the overly-restrictive check "each variable in the algebraic eqn keys must appear in the eqn" ([#1510](https://github.com/pybamm-team/PyBaMM/pull/1510))
- Made parameters importable through pybamm ([#1475](https://github.com/pybamm-team/PyBaMM/pull/1475))

## Breaking changes

- Refactored the `particle` submodel module, with the models having no size distribution now found in `particle.no_distribution`, and those with a size distribution in `particle.size_distribution`. Renamed submodels to indicate the transport model (Fickian diffusion, polynomial profile) and if they are "x-averaged". E.g., `FickianManyParticles` and `FickianSingleParticle` are now `no_distribution.FickianDiffusion` and `no_distribution.XAveragedFickianDiffusion` ([#1602](https://github.com/pybamm-team/PyBaMM/pull/1602))
- Changed sensitivity API. Removed `ProcessedSymbolicVariable`, all sensitivity now handled within the solvers and `ProcessedVariable` () ([#1552](https://github.com/pybamm-team/PyBaMM/pull/1552))
- The `Yang2017` parameter set has been removed as the complete parameter set is not publicly available in the literature ([#1577](https://github.com/pybamm-team/PyBaMM/pull/1577))
- Changed how options are specified for the "loss of active material" and "particle cracking" submodels. "loss of active material" can now be one of "none", "stress-driven", or "reaction-driven", or a 2-tuple for different options in negative and positive electrode. Similarly "particle cracking" (now called "particle mechanics") can now be "none", "swelling only", "swelling and cracking", or a 2-tuple ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
- Changed the variable in the full diffusion model from "Electrolyte concentration" to "Porosity times concentration" ([#1476](https://github.com/pybamm-team/PyBaMM/pull/1476))
Expand Down Expand Up @@ -189,7 +205,6 @@ This release adds new operators for more complex models, some basic sensitivity
(e.g. `standard_parameters_lithium_ion` is now `LithiumIonParameters`) ([#1120](https://github.com/pybamm-team/PyBaMM/pull/1120))
- Renamed `quick_plot_vars` to `output_variables` in `Simulation` to be consistent with `QuickPlot`. Passing `quick_plot_vars` to `Simulation.plot()` has been deprecated and `output_variables` should be passed instead ([#1099](https://github.com/pybamm-team/PyBaMM/pull/1099))


# [v0.2.3](https://github.com/pybamm-team/PyBaMM/tree/v0.2.3) - 2020-07-01

This release enables the use of [Google Colab](https://colab.research.google.com/github/pybamm-team/PyBaMM/blob/main/) for running example notebooks, and adds some small new features and bug fixes.
Expand Down Expand Up @@ -338,7 +353,7 @@ This release introduces many new features and optimizations. All models can now

## Features

- Added LG M50 parameter set ([#854](https://github.com/pybamm-team/PyBaMM/pull/854))
- Added LG M50 parameter set from Chen 2020 ([#854](https://github.com/pybamm-team/PyBaMM/pull/854))
- Changed rootfinding algorithm to CasADi, scipy.optimize.root still accessible as an option ([#844](https://github.com/pybamm-team/PyBaMM/pull/844))
- Added capacitance effects to lithium-ion models ([#842](https://github.com/pybamm-team/PyBaMM/pull/842))
- Added NCA parameter set ([#824](https://github.com/pybamm-team/PyBaMM/pull/824))
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ keywords:
- "expression tree"
- "python"
- "symbolic differentiation"
version: 0.4.0
version: 21.08
repository-code: "https://github.com/pybamm-team/PyBaMM"
title: "Python Battery Mathematical Modelling (PyBaMM)"
58 changes: 1 addition & 57 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We use [GIT](https://en.wikipedia.org/wiki/Git) and [GitHub](https://en.wikipedi
1. Create an [issue](https://guides.github.com/features/issues/) where new proposals can be discussed before any coding is done.
2. Create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) of this repo (ideally on your own [fork](https://help.github.com/articles/fork-a-repo/)), where all changes will be made
3. Download the source code onto your local system, by [cloning](https://help.github.com/articles/cloning-a-repository/) the repository (or your fork of the repository).
4. [Install](#installation) PyBaMM with the developer options.
4. [Install](https://pybamm.readthedocs.io/en/latest/install/install-from-source.html) PyBaMM with the developer options.
5. [Test](#testing) if your installation worked, using the test script: `$ python run-tests.py --unit`.

You now have everything you need to start making changes!
Expand All @@ -44,62 +44,6 @@ You now have everything you need to start making changes!
Finally, if you really, really, _really_ love developing PyBaMM, have a look at the current [project infrastructure](#infrastructure).


## Installation

To install PyBaMM with all developer options follow the steps below:


1. Install tox using the commands below:
```bash
pip install tox # (Using this, you will need to additionally install tox in your virtual environment as decribed below)
# or
pip install pipx # (For installing pipx)
pipx install tox # (Using this, tox can automatically be accessed in your virtual environment)
```
You can also explore and install pipx from their [GitHub repository](https://github.com/pipxproject/pipx)

2. Install sundials using the command below:
```bash
# (Skip this step for Windows installation)
brew install sundials # (MacOS)
#
tox -e pybamm-requires # (GNU/Linux)
```
3. Installing PyBaMM

This can be achieved by forking the repository and cloning it in your machine.

4. Navigate to the cloned repository and create a virtual environment using the commands below:
```bash
tox -e dev # (GNU/Linux and MacOS)
#
python -m tox -e windows-dev # (Windows)
```

This will

a. Create a virtual environment located at `.tox/dev`.

b. Install all the dependencies for PyBaMM, including the ones for documentation and development.

c. Tell Python to use your local pybamm files when you use `import pybamm` anywhere on your system.

5. Finally, activate your environment.


```bash
source .tox/dev/bin/activate # (GNU/Linux and MacOS)
#
.tox\windows-dev\Scripts\activate.bat # (Windows)
```
6. Inside the virtual environment, type:
```bash
pip install tox # (Skip this step if you used pipx above)
```


Full documentation with an installation guide can be found [here](https://pybamm.readthedocs.io/en/latest/install/install-from-source.html)

## Coding style guidelines

PyBaMM follows the [PEP8 recommendations](https://www.python.org/dev/peps/pep-0008/) for coding style. These are very common guidelines, and community tools have been developed to check how well projects implement them.
Expand Down
4 changes: 2 additions & 2 deletions FindSUNDIALS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# find the SUNDIALS include directories
find_path(SUNDIALS_INCLUDE_DIR
NAMES
ida/ida.h
idas/idas.h
sundials/sundials_math.h
sundials/sundials_types.h
sunlinsol/sunlinsol_klu.h
Expand All @@ -39,7 +39,7 @@ find_path(SUNDIALS_INCLUDE_DIR
)

set(SUNDIALS_WANT_COMPONENTS
sundials_ida
sundials_idas
sundials_sunlinsolklu
sundials_sunmatrixsparse
sundials_nvecserial
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![release](https://img.shields.io/github/v/release/pybamm-team/PyBaMM?color=yellow)](https://github.com/pybamm-team/PyBaMM/releases)
[![black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg)](#-contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

</div>
Expand Down Expand Up @@ -175,6 +175,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/alibh95"><img src="https://avatars.githubusercontent.com/u/65511923?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ali Hussain Umar Bhatti</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=alibh95" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=alibh95" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/molel-gt"><img src="https://avatars.githubusercontent.com/u/81125862?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Leshinka Molel</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=molel-gt" title="Code">💻</a> <a href="#ideas-molel-gt" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/tobykirk"><img src="https://avatars.githubusercontent.com/u/42966045?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tobykirk</b></sub></a><br /><a href="#ideas-tobykirk" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=tobykirk" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=tobykirk" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/chuckliu1979"><img src="https://avatars.githubusercontent.com/u/13491954?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chuck Liu</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Achuckliu1979" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=chuckliu1979" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/partben"><img src="https://avatars.githubusercontent.com/u/88316576?v=4?s=100" width="100px;" alt=""/><br /><sub><b>partben</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=partben" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
author = "The PyBaMM Team"

# The short X.Y version
version = "0.4"
version = "21.08"
# The full version, including alpha/beta/rc tags
release = "0.4.0"
release = "21.08"


# -- General configuration ---------------------------------------------------
Expand Down
37 changes: 37 additions & 0 deletions docs/source/expression_tree/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ Functions
.. autoclass:: pybamm.SpecificFunction
:members:

.. autoclass:: pybamm.Arcsinh
:members:

.. autofunction:: pybamm.arcsinh

.. autoclass:: pybamm.Arctan
:members:

.. autofunction:: pybamm.arctan

.. autoclass:: pybamm.Cos
:members:

Expand All @@ -17,6 +27,13 @@ Functions

.. autofunction:: pybamm.cosh

.. autoclass:: pybamm.Erf
:members:

.. autofunction:: pybamm.erf

.. autofunction:: pybamm.erfc

.. autoclass:: pybamm.Exponential
:members:

Expand All @@ -27,10 +44,20 @@ Functions

.. autofunction:: pybamm.log

.. autofunction:: pybamm.log10

.. autoclass:: pybamm.Max
:members:

.. autofunction:: pybamm.max

.. autoclass:: pybamm.Min
:members:

.. autofunction:: pybamm.min

.. autofunction:: pybamm.sech

.. autoclass:: pybamm.Sin
:members:

Expand All @@ -40,3 +67,13 @@ Functions
:members:

.. autofunction:: pybamm.sinh

.. autoclass:: pybamm.Sqrt
:members:

.. autofunction:: pybamm.sqrt

.. autoclass:: pybamm.Tanh
:members:

.. autofunction:: pybamm.tanh

This file was deleted.

This file was deleted.

5 changes: 1 addition & 4 deletions docs/source/models/submodels/particle/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ Particle
:maxdepth: 1

base_particle
fickian_single_particle
fickian_many_particles
polynomial_single_particle
polynomial_many_particles
no_distribution/index
size_distribution/index
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fickian Diffusion
=================

.. autoclass:: pybamm.particle.no_distribution.FickianDiffusion
:members:


10 changes: 10 additions & 0 deletions docs/source/models/submodels/particle/no_distribution/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
No Particle-Size Distribution
=============================

.. toctree::
:maxdepth: 1

fickian_diffusion
x_averaged_fickian_diffusion
polynomial_profile
x_averaged_polynomial_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Polynomial Profile
==================

.. autoclass:: pybamm.particle.no_distribution.PolynomialProfile
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
X-averaged Fickian Diffusion
============================

.. autoclass:: pybamm.particle.no_distribution.XAveragedFickianDiffusion
:members:

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
X-averaged Polynomial Profile
=============================

.. autoclass:: pybamm.particle.no_distribution.XAveragedPolynomialProfile
:members:

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Particle Size Distribution Base Model
=====================================

.. autoclass:: pybamm.particle.BaseSizeDistribution
.. autoclass:: pybamm.particle.size_distribution.BaseSizeDistribution
:members:

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fickian Diffusion
=================

.. autoclass:: pybamm.particle.size_distribution.FickianDiffusion
:members:


This file was deleted.

Loading

0 comments on commit ebb5d3f

Please sign in to comment.