Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/pybamm-team/PyBaMM into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
DrSOKane committed Nov 22, 2023
2 parents 8aa17f9 + 2ee8da2 commit bcc1a37
Show file tree
Hide file tree
Showing 72 changed files with 545 additions and 375 deletions.
4 changes: 3 additions & 1 deletion .github/release_workflow.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release workflow

This file contains the workflow required to make a `PyBaMM` release on GitHub and PyPI by the maintainers.
This file contains the workflow required to make a `PyBaMM` release on GitHub, PyPI, and conda-forge by the maintainers.

## rc0 releases (automated)

Expand Down Expand Up @@ -77,3 +77,5 @@ Some other essential things to check throughout the release process -
git tag -f <tag_name> <commit_hash>
git push -f <pybamm-team/PyBaMM_remote_name> <tag_name> # can only be carried out by the maintainers
```
- If changes are made to the API, console scripts, entry points, new optional dependencies are added, support for major Python versions is dropped or added, or core project information and metadata are modified at the time of the release, make sure to update the `meta.yaml` file in the `recipe/` folder of the [conda-forge/pybamm-feedstock](https://github.com/conda-forge/pybamm-feedstock) repository accordingly by following the instructions in the [conda-forge documentation](https://conda-forge.org/docs/maintainer/updating_pkgs.html#updating-the-feedstock-repository) and re-rendering the recipe
- The conda-forge release workflow will automatically be triggered following a stable PyPI release, and the aforementioned updates should be carried out directly in the main repository by pushing changes to the automated PR created by the conda-forge-bot. A manual PR can also be created if the updates are not included in the automated PR for some reason. This manual PR **must** bump the build number in `meta.yaml` and **must** be from a personal fork of the repository.
32 changes: 12 additions & 20 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,62 +66,54 @@ jobs:
sudo apt install gfortran gcc libopenblas-dev graphviz pandoc
sudo apt install texlive-full
# Added fixes to homebrew installs:
# rm -f /usr/local/bin/2to3
# (see https://github.com/actions/virtual-environments/issues/2322)
- name: Install MacOS system dependencies
- name: Install macOS system dependencies
if: matrix.os == 'macos-latest'
run: |
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3*
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*
brew update
brew install graphviz
brew install openblas
brew install graphviz openblas
brew reinstall gcc
- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz --version=2.38.0.20190211

- name: Install standard Python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade pip wheel setuptools nox
- name: Install SuiteSparse and SUNDIALS on GNU/Linux
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Run unit tests for GNU/Linux with Python 3.8, 3.9, and 3.10, and for macOS and Windows with all Python versions
if: (matrix.os == 'ubuntu-latest' && matrix.python-version != 3.11) || (matrix.os != 'ubuntu-latest')
run: pipx run nox -s unit
run: python -m nox -s unit

- name: Run unit tests for GNU/Linux with Python 3.11 and generate coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
run: pipx run nox -s coverage
run: python -m nox -s coverage

- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
uses: codecov/codecov-action@v3.1.4

- name: Run integration tests
run: pipx run nox -s integration
run: python -m nox -s integration

- name: Install docs dependencies and run doctests
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s doctests
run: python -m nox -s doctests

- name: Check if the documentation can be built
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s docs
run: python -m nox -s docs

- name: Install dev dependencies and run example tests
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s examples
run: python -m nox -s examples

- name: Run example scripts tests
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s scripts
run: python -m nox -s scripts

#M-series Mac Mini
build-apple-mseries:
Expand Down
66 changes: 29 additions & 37 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
if: matrix.os == 'ubuntu-latest'
with:
packages: gfortran gcc graphviz pandoc
Expand All @@ -75,7 +75,6 @@ jobs:
NONINTERACTIVE: 1
run: |
brew analytics off
brew update
brew install graphviz openblas
- name: Install Windows system dependencies
Expand All @@ -90,10 +89,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install -e .[all,docs]
pip install --upgrade pip wheel setuptools nox
- name: Cache pybamm-requires nox environment for GNU/Linux
uses: actions/cache@v3
Expand All @@ -111,10 +109,10 @@ jobs:

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
run: pipx run nox -s unit
run: python -m nox -s unit

# Runs only on Ubuntu with Python 3.11
check_coverage:
Expand All @@ -130,7 +128,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
with:
packages: gfortran gcc graphviz pandoc
execute_install_scripts: true
Expand All @@ -150,10 +148,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools nox
pip install -e .[all,docs]
- name: Cache pybamm-requires nox environment for GNU/Linux
uses: actions/cache@v3
Expand All @@ -169,10 +166,10 @@ jobs:
key: nox-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Run unit tests for Ubuntu with Python 3.11 and generate coverage report
run: pipx run nox -s coverage
run: python -m nox -s coverage

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
Expand All @@ -193,7 +190,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
if: matrix.os == 'ubuntu-latest'
with:
packages: gfortran gcc graphviz pandoc
Expand All @@ -218,7 +215,6 @@ jobs:
NONINTERACTIVE: 1
run: |
brew analytics off
brew update
brew install graphviz openblas
- name: Install Windows system dependencies
Expand All @@ -233,10 +229,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install -e .[all,docs]
pip install --upgrade pip wheel setuptools nox
- name: Cache pybamm-requires nox environment for GNU/Linux
uses: actions/cache@v3
Expand All @@ -254,10 +249,10 @@ jobs:

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
if: matrix.os == 'ubuntu-latest'
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Run integration tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
run: pipx run nox -s integration
run: python -m nox -s integration

# Runs only on Ubuntu with Python 3.11. Skips IDAKLU module compilation
# for speedups, which is already tested in other jobs.
Expand All @@ -274,7 +269,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
with:
packages: gfortran gcc graphviz pandoc
execute_install_scripts: true
Expand All @@ -294,16 +289,15 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install -e .[all,docs]
pip install --upgrade pip wheel setuptools nox
- name: Install docs dependencies and run doctests for GNU/Linux with Python 3.11
run: pipx run nox -s doctests
run: python -m nox -s doctests

- name: Check if the documentation can be built for GNU/Linux with Python 3.11
run: pipx run nox -s docs
run: python -m nox -s docs

# Runs only on Ubuntu with Python 3.11
run_example_tests:
Expand All @@ -319,7 +313,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
with:
packages: gfortran gcc graphviz pandoc
execute_install_scripts: true
Expand All @@ -339,10 +333,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install -e .[all,docs]
pip install --upgrade pip wheel setuptools nox
- name: Cache pybamm-requires nox environment for GNU/Linux
uses: actions/cache@v3
Expand All @@ -358,10 +351,10 @@ jobs:
key: nox-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Install dev dependencies and run example tests for GNU/Linux with Python 3.11
run: pipx run nox -s examples
run: python -m nox -s examples

# Runs only on Ubuntu with Python 3.11
run_scripts_tests:
Expand All @@ -377,7 +370,7 @@ jobs:

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
with:
packages: gfortran gcc graphviz
execute_install_scripts: true
Expand All @@ -397,10 +390,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install PyBaMM dependencies
- name: Install standard Python dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install -e .[all,docs]
pip install --upgrade pip wheel setuptools nox
- name: Cache pybamm-requires nox environment for GNU/Linux
uses: actions/cache@v3
Expand All @@ -416,7 +408,7 @@ jobs:
key: nox-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
run: pipx run nox -s pybamm-requires
run: python -m nox -s pybamm-requires

- name: Install dev dependencies and run example scripts tests for GNU/Linux with Python 3.11
run: pipx run nox -s scripts
run: python -m nox -s scripts
12 changes: 3 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.1"
rev: "v0.1.6"
hooks:
- id: ruff
args: [--fix, --ignore=E741, --exclude=__init__.py]

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.0.284]
args: ["--fix","--ignore=E501,E402"]
args: [--fix, --show-fixes]
types_or: [python, pyi, jupyter]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
Expand Down
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

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

- Fixed bug that made identical Experiment steps with different end times crash ([#3516](https://github.com/pybamm-team/PyBaMM/pull/3516))
- 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))

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

## Features

Expand All @@ -19,6 +25,9 @@

## Bug fixes

- Fixed a bug where the JaxSolver would fails when using GPU support with no input parameters ([#3423](https://github.com/pybamm-team/PyBaMM/pull/3423))
- Make pybamm importable with minimal dependencies ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044), [#3475](https://github.com/pybamm-team/PyBaMM/pull/3475))
- Fixed a bug where supplying an initial soc did not work with half cell models ([#3456](https://github.com/pybamm-team/PyBaMM/pull/3456))
- Fixed a bug where empty lists passed to QuickPlot resulted in an IndexError and did not return a meaningful error message ([#3359](https://github.com/pybamm-team/PyBaMM/pull/3359))
- Fixed a bug where there was a missing thermal conductivity in the thermal pouch cell models ([#3330](https://github.com/pybamm-team/PyBaMM/pull/3330))
- Fixed a bug that caused incorrect results of “{Domain} electrode thickness change [m]” due to the absence of dimension for the variable `electrode_thickness_change`([#3329](https://github.com/pybamm-team/PyBaMM/pull/3329)).
Expand All @@ -37,7 +46,6 @@
- Error generated when invalid parameter values are passed ([#3132](https://github.com/pybamm-team/PyBaMM/pull/3132))
- Parameters in `Prada2013` have been updated to better match those given in the paper, which is a 2.3 Ah cell, instead of the mix-and-match with the 1.1 Ah cell from Lain2019 ([#3096](https://github.com/pybamm-team/PyBaMM/pull/3096))
- The `OneDimensionalX` thermal model has been updated to account for edge/tab cooling and account for the current collector volumetric heat capacity. It now gives the correct behaviour compared with a lumped model with the correct total heat transfer coefficient and surface area for cooling. ([#3042](https://github.com/pybamm-team/PyBaMM/pull/3042))
- Fixed a bug where supplying an initial soc did not work with half cell models ([#3456](https://github.com/pybamm-team/PyBaMM/pull/3456))

## Optimizations

Expand All @@ -57,7 +65,7 @@
- Added option to use an empirical hysteresis model for the diffusivity and exchange-current density ([#3194](https://github.com/pybamm-team/PyBaMM/pull/3194))
- Double-layer capacity can now be provided as a function of temperature ([#3174](https://github.com/pybamm-team/PyBaMM/pull/3174))
- `pybamm_install_jax` is deprecated. It is now replaced with `pip install pybamm[jax]` ([#3163](https://github.com/pybamm-team/PyBaMM/pull/3163))
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044))
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044), [#3475](https://github.com/pybamm-team/PyBaMM/pull/3475))

# [v23.5](https://github.com/pybamm-team/PyBaMM/tree/v23.5) - 2023-06-18

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: "23.9rc0"
version: "23.9"
repository-code: "https://github.com/pybamm-team/PyBaMM"
title: "Python Battery Mathematical Modelling (PyBaMM)"
Loading

0 comments on commit bcc1a37

Please sign in to comment.