Skip to content

Commit

Permalink
Merge branch 'develop' into i3558-repair-wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Dec 14, 2023
2 parents 8e59c1b + 903323e commit ab6b6bd
Show file tree
Hide file tree
Showing 81 changed files with 1,392 additions and 214 deletions.
37 changes: 37 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,43 @@
"code",
"test"
]
},
{
"login": "chmabaur",
"name": "chmabaur",
"avatar_url": "https://avatars.githubusercontent.com/u/127507466?v=4",
"profile": "https://github.com/chmabaur",
"contributions": [
"bug",
"code"
]
},
{
"login": "AbhishekChaudharii",
"name": "Abhishek Chaudhari",
"avatar_url": "https://avatars.githubusercontent.com/u/91185083?v=4",
"profile": "https://github.com/AbhishekChaudharii",
"contributions": [
"doc"
]
},
{
"login": "shubhambhar007",
"name": "Shubham Bhardwaj",
"avatar_url": "https://avatars.githubusercontent.com/u/32607282?v=4",
"profile": "https://github.com/shubhambhar007",
"contributions": [
"infra"
]
},
{
"login": "jlauber18",
"name": "Jonathan Lauber",
"avatar_url": "https://avatars.githubusercontent.com/u/28939653?v=4",
"profile": "https://github.com/jlauber18",
"contributions": [
"infra"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
27 changes: 1 addition & 26 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ jobs:
echo "tag=all" >> "$GITHUB_OUTPUT"
fi
- name: Build and push Docker image to Docker Hub (no solvers)
if: matrix.build-args == 'No solvers'
- name: Build and push Docker image to Docker Hub (${{ matrix.build-args }})
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -58,29 +57,5 @@ jobs:
push: true
platforms: linux/amd64, linux/arm64

- name: Build and push Docker image to Docker Hub (with ODES and IDAKLU solvers)
if: matrix.build-args == 'ODES' || matrix.build-args == 'IDAKLU'
uses: docker/build-push-action@v5
with:
context: .
file: scripts/Dockerfile
tags: pybamm/pybamm:${{ steps.tags.outputs.tag }}
push: true
build-args: ${{ matrix.build-args }}=true
platforms: linux/amd64, linux/arm64

- name: Build and push Docker image to Docker Hub (with ALL and JAX solvers)
if: matrix.build-args == 'ALL' || matrix.build-args == 'JAX'
uses: docker/build-push-action@v5
with:
context: .
file: scripts/Dockerfile
tags: pybamm/pybamm:${{ steps.tags.outputs.tag }}
push: true
build-args: ${{ matrix.build-args }}=true
# exclude arm64 for JAX and ALL builds for now, see
# https://github.com/google/jax/issues/13608
platforms: linux/amd64

- name: List built image(s)
run: docker images
4 changes: 2 additions & 2 deletions .github/workflows/periodic_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- uses: actions/checkout@v4
name: Check out PyBaMM repository

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Set up Python
with:
python-version: 3.8
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:

jobs:
remind:
if: github.repository_owner == 'pybamm-team'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/run_benchmarks_over_history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install nox and asv
Expand All @@ -48,12 +48,13 @@ jobs:
path: results

publish-results:
if: github.repository_owner == 'pybamm-team'
name: Push and publish results
needs: benchmarks
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install asv
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Check style
run: |
python -m pip install pre-commit
git add .
pre-commit run ruff
build:
Expand All @@ -50,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -112,6 +113,7 @@ jobs:

#M-series Mac Mini
build-apple-mseries:
if: github.repository_owner == 'pybamm-team'
needs: style
runs-on: [self-hosted, macOS, ARM64]
env:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Check style
run: |
python -m pip install pre-commit
git add .
pre-commit run ruff
run_unit_tests:
Expand Down Expand Up @@ -85,7 +86,7 @@ jobs:

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -141,7 +142,7 @@ jobs:
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
Expand Down Expand Up @@ -221,7 +222,7 @@ jobs:

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -278,7 +279,7 @@ jobs:
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
Expand Down Expand Up @@ -320,7 +321,7 @@ jobs:
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
Expand Down Expand Up @@ -374,7 +375,7 @@ jobs:
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
ref: '${{ env.NON_RC_VERSION }}'

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/validation_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
build:
if: github.repository_owner == 'pybamm-team'
name: Dispatch to `pybamm-validation`
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/work_precision_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:

jobs:
benchmarks_on_release:
if: github.repository_owner == 'pybamm-team'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Get current date
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
rev: "v0.1.7"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Features

- Added method to get QuickPlot axes by variable ([#3596](https://github.com/pybamm-team/PyBaMM/pull/3596))
- Added custom experiment terminations ([#3596](https://github.com/pybamm-team/PyBaMM/pull/3596))
- Mechanical parameters are now a function of stoichiometry and temperature ([#3576](https://github.com/pybamm-team/PyBaMM/pull/3576))
- Added a new unary operator, `EvaluateAt`, that evaluates a spatial variable at a given position ([#3573](https://github.com/pybamm-team/PyBaMM/pull/3573))
- Added a method, `insert_reference_electrode`, to `pybamm.lithium_ion.BaseModel` that insert a reference electrode to measure the electrolyte potential at a given position in space and adds new variables that mimic a 3E cell setup. ([#3573](https://github.com/pybamm-team/PyBaMM/pull/3573))
- Serialisation added so models can be written to/read from JSON ([#3397](https://github.com/pybamm-team/PyBaMM/pull/3397))

## Bug fixes
Expand All @@ -11,6 +16,14 @@
- Fixed bug in calculation of theoretical energy that made it very slow ([#3506](https://github.com/pybamm-team/PyBaMM/pull/3506))
- The irreversible plating model now increments `f"{Domain} dead lithium concentration [mol.m-3]"`, not `f"{Domain} lithium plating concentration [mol.m-3]"` as it did previously. ([#3485](https://github.com/pybamm-team/PyBaMM/pull/3485))

## Optimizations

- Updated `jax` and `jaxlib` to the latest available versions and added Windows (Python 3.9+) support for the Jax solver ([#3550](https://github.com/pybamm-team/PyBaMM/pull/3550))

## Breaking changes

- Dropped support for the `[jax]` extra, i.e., the Jax solver when running on Python 3.8. The Jax solver is now available on Python 3.9 and above ([#3550](https://github.com/pybamm-team/PyBaMM/pull/3550))

# [v23.9](https://github.com/pybamm-team/PyBaMM/tree/v23.9) - 2023-10-31

## Features
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![code style](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-70-orange.svg)](#-contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

</div>
Expand Down Expand Up @@ -270,6 +270,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://aitorres.com"><img src="https://avatars.githubusercontent.com/u/26191851?v=4?s=100" width="100px;" alt="Andrés Ignacio Torres"/><br /><sub><b>Andrés Ignacio Torres</b></sub></a><br /><a href="#infra-aitorres" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Agnik7"><img src="https://avatars.githubusercontent.com/u/77234005?v=4?s=100" width="100px;" alt="Agnik Bakshi"/><br /><sub><b>Agnik Bakshi</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=Agnik7" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RuiheLi"><img src="https://avatars.githubusercontent.com/u/84007676?v=4?s=100" width="100px;" alt="RuiheLi"/><br /><sub><b>RuiheLi</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=RuiheLi" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=RuiheLi" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chmabaur"><img src="https://avatars.githubusercontent.com/u/127507466?v=4?s=100" width="100px;" alt="chmabaur"/><br /><sub><b>chmabaur</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Achmabaur" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=chmabaur" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AbhishekChaudharii"><img src="https://avatars.githubusercontent.com/u/91185083?v=4?s=100" width="100px;" alt="Abhishek Chaudhari"/><br /><sub><b>Abhishek Chaudhari</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=AbhishekChaudharii" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shubhambhar007"><img src="https://avatars.githubusercontent.com/u/32607282?v=4?s=100" width="100px;" alt="Shubham Bhardwaj"/><br /><sub><b>Shubham Bhardwaj</b></sub></a><br /><a href="#infra-shubhambhar007" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jlauber18"><img src="https://avatars.githubusercontent.com/u/28939653?v=4?s=100" width="100px;" alt="Jonathan Lauber"/><br /><sub><b>Jonathan Lauber</b></sub></a><br /><a href="#infra-jlauber18" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

doctest_global_setup = """
from docs import *
import pybamm
"""

# Add any paths that contain templates here, relative to this directory.
Expand Down
25 changes: 25 additions & 0 deletions docs/source/api/experiment/experiment_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,28 @@ directly:

.. autoclass:: pybamm.step._Step
:members:

Step terminations
-----------------

Standard step termination events are implemented by the following classes, which are
called when the termination is specified by a specific string. These classes can be
either be called directly or via the string format specified in the class docstring

.. autoclass:: pybamm.step.CrateTermination
:members:

.. autoclass:: pybamm.step.CurrentTermination
:members:

.. autoclass:: pybamm.step.VoltageTermination
:members:

The following classes can be used to define custom terminations for an experiment
step:

.. autoclass:: pybamm.step.BaseTermination
:members:

.. autoclass:: pybamm.step.CustomTermination
:members:
Loading

0 comments on commit ab6b6bd

Please sign in to comment.