Skip to content

Commit

Permalink
Merge branch 'develop' into issue-2670-interp2d
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Apr 28, 2023
2 parents 38925e1 + aa80775 commit 4b52d2e
Show file tree
Hide file tree
Showing 170 changed files with 678 additions and 235 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
HEAD_COMMIT=$(git rev-parse HEAD)
echo $BASE_COMMIT | tee commits_to_compare.txt
echo $HEAD_COMMIT | tee -a commits_to_compare.txt
asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr -v
asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr --strict -v
- name: Compare commits' benchmark results
run: |
BASE_COMMIT=$(head -1 commits_to_compare.txt)
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/need_reply_remove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Remove needs-reply label

on:
issue_comment:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
if: |
github.event.comment.author_association != 'OWNER' &&
github.event.comment.author_association != 'COLLABORATOR'
steps:
- name: Remove needs-reply label
uses: octokit/[email protected]
continue-on-error: true
with:
route: DELETE /repos/:repository/issues/:issue/labels/:label
repository: ${{ github.repository }}
issue: ${{ github.event.issue.number }}
label: needs-reply
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/needs_reply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Close old issues that need reply

on:
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Close old issues that need reply
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: needs-reply
16 changes: 13 additions & 3 deletions .github/workflows/periodic_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ 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 Linux system dependencies
run: |
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev
- name: Install python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools virtualenv asv wget cmake casadi numpy
- name: Install SuiteSparse and Sundials
run: python scripts/install_KLU_Sundials.py
- name: Run benchmarks
run: |
asv machine --machine "GitHubRunner"
asv run --machine "GitHubRunner" NEW
asv run --machine "GitHubRunner" NEW --show-stderr --strict -v
env:
SUNDIALS_INST: $HOME/.local
LD_LIBRARY_PATH: $HOME/.local/lib
- name: Upload results as artifact
uses: actions/upload-artifact@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: tox -e pybamm-requires

- name: Run unit tests for GNU/Linux with Python 3.8
- 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

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.259"
rev: "v0.0.261"
hooks:
- id: ruff
args: [--ignore=E741, --exclude=__init__.py]
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

# 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))
- 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))

## Bug fixes

- 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))

# Breaking changes

- Made `Jupyter` a development only dependency. Now `Jupyter` would not be a required dependency for users while installing `PyBaMM`. ([#2846](https://github.com/pybamm-team/PyBaMM/pull/2846))

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

## Features
Expand All @@ -14,12 +30,13 @@

## Bug fixes

- 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 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))
- Fixed `plot_voltage_components` so that the sum of overpotentials is now equal to the voltage ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
- Fixed use of last_state as starting_solution in Simulation.solve() ([#2822](https://github.com/pybamm-team/PyBaMM/pull/2822))

## Optimizations

Expand Down
1 change: 1 addition & 0 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
"build_command": [
"/bin/rm -rf pybind11",
"/usr/bin/git clone --depth 1 --branch v2.6.2 https://github.com/pybind/pybind11.git",
"python setup.py build",
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
Expand Down
12 changes: 7 additions & 5 deletions benchmarks/different_model_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TimeSolveLithiumPlating:

def setup(self, model, params, solver_class):
SolveModel.solve_setup(
self, "OKane2020", model, "lithium plating", params, solver_class
self, "OKane2022", model, "lithium plating", params, solver_class
)

def time_solve_model(self, model, params, solver_class):
Expand All @@ -139,12 +139,10 @@ class TimeBuildModelSEI:
"none",
"constant",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
)

Expand All @@ -160,12 +158,10 @@ class TimeSolveSEI:
"none",
"constant",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
[pybamm.CasadiSolver, pybamm.IDAKLUSolver],
)
Expand Down Expand Up @@ -263,6 +259,12 @@ class TimeSolveSurfaceForm:
)

def setup(self, model, params, solver_class):
if (model, params, solver_class) == (
pybamm.lithium_ion.SPM,
"differential",
pybamm.IDAKLUSolver,
):
raise NotImplementedError
SolveModel.solve_setup(
self, "Marquis2019", model, "surface form", params, solver_class
)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/time_setup_models_and_sims.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Ramadass2004",
"Mohtat2020",
"Chen2020",
"Chen2020_plating",
"OKane2022",
"Ecker2015",
]

Expand Down
7 changes: 7 additions & 0 deletions benchmarks/time_sims_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class TimeSimulation:
}

def setup(self, experiment, parameters, model_class, solver_class):
if (experiment, parameters, model_class, solver_class) == (
"GITT",
"Marquis2019",
pybamm.lithium_ion.DFN,
pybamm.CasadiSolver,
):
raise NotImplementedError
self.param = pybamm.ParameterValues(parameters)
self.model = model_class()
self.solver = solver_class()
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/time_solve_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ class TimeSolveDFN:
)

def setup(self, solve_first, parameters, solver_class):
if (solve_first, parameters, solver_class) == (
True,
"ORegan2022",
pybamm.CasadiSolver,
):
raise NotImplementedError
self.solver = solver_class()
self.model = pybamm.lithium_ion.DFN()
c_rate = 1
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pandas >= 0.24
anytree >= 2.4.3
autograd >= 1.2
scikit-fem >= 0.2.0
casadi >= 3.5.0
casadi >= 3.6.0
imageio>=2.9.0
jupyter # For example notebooks
pybtex
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/installation/GNU-linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Prerequisites
=============

To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed.
To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, 3.10, or 3.11 installed.

To install Python 3 on Debian-based distribution (Debian, Ubuntu, Linux
mint), open a terminal and run
Expand Down Expand Up @@ -46,7 +46,7 @@ User install

We recommend to install PyBaMM within a virtual environment, in order
not to alter any distribution Python files.
First, make sure you are using Python 3.8 or 3.9.
First, make sure you are using Python 3.8, 3.9, 3.10, or 3.11.
To create a virtual environment ``env`` within your current directory type:

.. code:: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ or download the source archive on the repository's homepage.

To install PyBaMM, you will need:

- Python 3 (PyBaMM supports versions 3.8 and 3.9)
- Python 3 (PyBaMM supports versions 3.8, 3.9, 3.10, and 3.11)
- The Python headers file for your current Python version.
- A BLAS library (for instance `openblas <https://www.openblas.net/>`_).
- A C compiler (ex: ``gcc``).
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/installation/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Windows
Prerequisites
-------------

To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed.
To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, 3.10, or 3.11 installed.

To install Python 3 download the installation files from `Python’s
website <https://www.python.org/downloads/windows/>`__. Make sure to
Expand Down
Loading

0 comments on commit 4b52d2e

Please sign in to comment.