Skip to content

Commit

Permalink
Squash previous 69 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Jun 17, 2023
1 parent 3154c0b commit b5372be
Show file tree
Hide file tree
Showing 63 changed files with 3,052 additions and 1,841 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,15 @@
"code",
"bug"
]
},
{
"login": "julian-evers",
"name": "julian-evers",
"avatar_url": "https://avatars.githubusercontent.com/u/133691040?v=4",
"profile": "https://github.com/julian-evers",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
source = pybamm
concurrency = multiprocessing
2 changes: 1 addition & 1 deletion .github/workflows/periodic_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev
sudo apt-get install gfortran gcc libopenblas-dev
- name: Install python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools virtualenv asv wget cmake casadi numpy
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ jobs:
.\bootstrap-vcpkg.bat
- name: Cache packages installed through vcpkg on windows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: vckpg_binary_cache
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: ${{ runner.os }}-build-VS2022-${{ env.cache-name }}-${{ hashFiles('vcpkg*.json') }}

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.10.4 https://github.com/pybind/pybind11.git

- name: Install sundials on macOS
- name: Install SUNDIALS on macOS
if: matrix.os == 'macos-latest'
run: |
# https://github.com/actions/virtual-environments/issues/1280
Expand All @@ -95,6 +95,7 @@ jobs:
rm -f /usr/local/bin/python3*
brew update
brew reinstall gcc
brew install libomp
python -m pip install cmake wget
python scripts/install_KLU_Sundials.py
Expand All @@ -104,7 +105,7 @@ jobs:
# TODO: openblas no longer available on centos 7 i686 image, use blas instead for now
CIBW_BEFORE_ALL_LINUX: >
yum -y install blas-devel lapack-devel &&
bash build_manylinux_wheels/install_sundials.sh 5.8.1 5.7.0
bash build_manylinux_wheels/install_sundials.sh 5.8.1 6.5.0
CIBW_BEFORE_BUILD_LINUX: "python -m pip install cmake casadi numpy"
CIBW_BEFORE_BUILD_MACOS: >
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_benchmarks_over_history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install tox and asv
run: pip install -U pip "tox<4" asv
- name: Install nox and asv
run: pip install -U pip nox asv
- name: Fetch develop branch
# Not required when worklow trigerred
# on develop, but useful when
Expand Down
36 changes: 15 additions & 21 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,41 +86,35 @@ jobs:

- name: Install standard python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install "tox<4"
python -m pip install --upgrade pip wheel setuptools nox
- name: Install SuiteSparse and Sundials
if: matrix.os == 'ubuntu-latest'
run: tox -e pybamm-requires
run: nox -s pybamm-requires

- name: Run unit tests for GNU/Linux with Python 3.8, 3.10, and 3.11
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.9
run: python -m tox -e unit
- name: Run unit tests for GNU/Linux with Python 3.8, 3.9, and 3.10
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.11
run: nox -s unit

- name: Run unit tests for GNU/Linux with Python 3.9 and generate coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9
run: python -m tox -e coverage
- 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: nox -s coverage

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

- name: Run integration tests for GNU/Linux
if: matrix.os == 'ubuntu-latest'
run: python -m tox -e integration
- name: Run integration tests
run: nox -s integration

- name: Run unit tests for Windows and MacOS
if: matrix.os != 'ubuntu-latest'
run: python -m tox -e mac-windows-unit

- name: Run integration tests for Windows and MacOS
if: matrix.os != 'ubuntu-latest'
run: python -m tox -e mac-windows-integration
run: nox -s unit

- name: Install docs dependencies and run doctests
if: matrix.os == 'ubuntu-latest'
run: tox -e doctests
run: nox -s doctests

- name: Install dev dependencies and run example tests
if: matrix.os == 'ubuntu-latest'
run: tox -e examples
run: nox -s examples
49 changes: 33 additions & 16 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,35 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Install and cache apt packages
- name: Install Linux system dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.3.0
if: matrix.os == 'ubuntu-latest'
with:
packages: gfortran gcc graphviz
execute_install_scripts: true

# dot -c is for registering graphviz fonts and plugins
- name: Install OpenBLAS and TexLive for Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev graphviz
sudo apt install texlive-full
sudo dot -c
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng
# 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
if: matrix.os == 'macos-latest'
env:
# Homebrew environment variables
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_GOOGLE_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
# Speed up CI
NONINTERACTIVE: 1
run: |
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3*
Expand All @@ -76,39 +93,39 @@ jobs:
if: matrix.os == 'windows-latest'
run: choco install graphviz --version=2.38.0.20190211

- name: Install standard python dependencies
- name: Install standard Python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install "tox<4"
python -m pip install nox
- name: Install SuiteSparse and Sundials
if: matrix.os == 'ubuntu-latest'
run: tox -e pybamm-requires
run: nox -s pybamm-requires

- name: Run unit tests for GNU/Linux with Python 3.8, 3.10, and 3.11
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.9
run: python -m tox -e unit
- name: Run unit tests for GNU/Linux with Python 3.8, 3.9, and 3.10
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.11
run: nox -s unit

- name: Run unit tests for GNU/Linux with Python 3.9 and generate coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9
run: python -m tox -e coverage
- 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: nox -s coverage

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

- name: Run integration tests for GNU/Linux with Python 3.11
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
run: python -m tox -e integration
run: nox -s integration

- name: Run unit tests for Windows and MacOS with all Python versions
if: matrix.os != 'ubuntu-latest'
run: python -m tox -e mac-windows-unit
run: nox -s unit

- name: Install docs dependencies and run doctests for GNU/Linux with Python 3.11
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
run: tox -e doctests
run: nox -s doctests

- name: Install dev dependencies and run example tests for GNU/Linux with Python 3.11
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
run: tox -e examples
run: nox -s examples
3 changes: 0 additions & 3 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Update version

on:
workflow_dispatch:
schedule:
# Run at 10 am UTC on 28th every month
- cron: 0 10 28 * *

jobs:
update-version:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ test.json
# tox
.tox/

# nox
.nox/

# vcpkg
vcpkg_installed/

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.269"
rev: "v0.0.272"
hooks:
- id: ruff
args: [--ignore=E741, --exclude=__init__.py]
20 changes: 16 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

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

## Bug fixes

- Realign 'count' increment in CasadiSolver._integrate() ([#2986](https://github.com/pybamm-team/PyBaMM/pull/2986))

## Features

- Enable multithreading in IDAKLU solver ([#2947](https://github.com/pybamm-team/PyBaMM/pull/2947))
- If a solution contains cycles and steps, the cycle number and step number are now saved when `solution.save_data()` is called ([#2931](https://github.com/pybamm-team/PyBaMM/pull/2931))
- Experiments can now be given a `start_time` to define when each step should be triggered ([#2616](https://github.com/pybamm-team/PyBaMM/pull/2616))

## Optimizations

- Test `JaxSolver`'s compatibility with Python `3.8`, `3.9`, `3.10`, and `3.11` ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958))
- Update Jax (0.4.8) and JaxLib (0.4.7) compatibility ([#2927](https://github.com/pybamm-team/PyBaMM/pull/2927))
- Migrate from `tox=3.28` to `nox` ([#3005](https://github.com/pybamm-team/PyBaMM/pull/3005))

## Bug fixes

- Fix `pybamm_install_odes` and update the required SUNDIALS version ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958))
- Fixed a bug where all data included in a BPX was incorrectly assumed to be given as a function of time.([#2957](https://github.com/pybamm-team/PyBaMM/pull/2957))
- Remove brew install for Mac from the recommended developer installation options for SUNDIALS ([#2925](https://github.com/pybamm-team/PyBaMM/pull/2925))
- Fix `bpx.py` to correctly generate parameters for "lumped" thermal model ([#2860](https://github.com/pybamm-team/PyBaMM/issues/2860))

## Breaking changes

- Deprecate functionality to load parameter set from a csv file. Parameter sets must now be provided as python dictionaries ([#2959](https://github.com/pybamm-team/PyBaMM/pull/2959))
- Tox support for Installation & testing has now been replaced by Nox ([#3005](https://github.com/pybamm-team/PyBaMM/pull/3005))

# [v23.4.1](https://github.com/pybamm-team/PyBaMM/tree/v23.4) - 2023-05-01

Expand All @@ -30,20 +41,21 @@
## Features

- Added verbose logging to `pybamm.print_citations()` and citation tags for the `pybamm.Citations` class so that users can now see where the citations were registered when running simulations ([#2862](https://github.com/pybamm-team/PyBaMM/pull/2862))
- Updated to casadi 3.6, which required some changes to the casadi integrator ([#2859](https://github.com/pybamm-team/PyBaMM/pull/2859))
- PyBaMM is now natively supported on Apple silicon chips (`M1/M2`) ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435))
- PyBaMM is now supported on Python `3.10` and `3.11` ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435))
- Updated to casadi 3.6, which required some changes to the casadi integrator. ([#2859](https://github.com/pybamm-team/PyBaMM/pull/2859))


## Optimizations

- Fixed deprecated `interp2d` method by switching to `xarray.DataArray` as the backend for `ProcessedVariable` ([#2907](https://github.com/pybamm-team/PyBaMM/pull/2907))

## Bug fixes

- Initial conditions for sensitivity equations calculated correctly ([#2920](https://github.com/pybamm-team/PyBaMM/pull/2920))
- Parameter sets can now contain the key "chemistry", and will ignore its value (this previously would give errors in some cases) ([#2901](https://github.com/pybamm-team/PyBaMM/pull/2901))
- Fixed a bug in the discretisation of initial conditions of a scaled variable ([#2856](https://github.com/pybamm-team/PyBaMM/pull/2856))
- Fixed keyerror on "all" when getting sensitivities from IDAKLU solver([#2883](https://github.com/pybamm-team/PyBaMM/pull/2883))
- Initial conditions for sensitivity equations calculated correctly ([#2920](https://github.com/pybamm-team/PyBaMM/pull/2920))
- Fixed a bug in the discretisation of initial conditions of a scaled variable ([#2856](https://github.com/pybamm-team/PyBaMM/pull/2856))

## Breaking changes

Expand All @@ -65,7 +77,7 @@

- Fix non-deteministic outcome of some tests in the test suite ([#2844](https://github.com/pybamm-team/PyBaMM/pull/2844))
- Fixed excessive RAM consumption when running multiple simulations ([#2823](https://github.com/pybamm-team/PyBaMM/pull/2823))
- Fixed use of last_state as starting_solution in Simulation.solve() ([#2822](https://github.com/pybamm-team/PyBaMM/pull/2822))
- Fixed use of `last_state` as `starting_solution` in `Simulation.solve()` ([#2822](https://github.com/pybamm-team/PyBaMM/pull/2822))
- Fixed a bug where variable bounds could not contain `InputParameters` ([#2795](https://github.com/pybamm-team/PyBaMM/pull/2795))
- Improved `model.latexify()` to have a cleaner and more readable output ([#2764](https://github.com/pybamm-team/PyBaMM/pull/2764))
- Fixed electrolyte conservation in the case of concentration-dependent transference number ([#2758](https://github.com/pybamm-team/PyBaMM/pull/2758))
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.4.1"
version: "23.5"
repository-code: "https://github.com/pybamm-team/PyBaMM"
title: "Python Battery Mathematical Modelling (PyBaMM)"
Loading

0 comments on commit b5372be

Please sign in to comment.