Skip to content

Commit

Permalink
Merge branch 'develop' into run-tests-together
Browse files Browse the repository at this point in the history
  • Loading branch information
prady0t authored May 25, 2024
2 parents 944926f + 6ba81b7 commit 4077c31
Show file tree
Hide file tree
Showing 172 changed files with 881,710 additions and 1,015 deletions.
22 changes: 21 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"files": [
"all_contributors.md"
"all_contributors.md",
"README.md"
],
"imageSize": 100,
"commit": false,
Expand Down Expand Up @@ -856,6 +857,25 @@
"contributions": [
"doc"
]
},
{
"login": "Hongmeiqi",
"name": "Hongmeiqi",
"avatar_url": "https://avatars.githubusercontent.com/u/143798726?v=4",
"profile": "https://github.com/Hongmeiqi",
"contributions": [
"doc"
]
},
{
"login": "mleot",
"name": "mleot",
"avatar_url": "https://avatars.githubusercontent.com/u/140573653?v=4",
"profile": "https://github.com/mleot",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
22 changes: 11 additions & 11 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Automatically request reviews from maintainers

# Package
/pybamm/discretisations/ @martinjrobins @rtimms @tinosulzer
/pybamm/experiment/ @brosaplanella @martinjrobins @rtimms @tinosulzer @TomTranter
/pybamm/expression_tree/ @martinjrobins @rtimms @tinosulzer
/pybamm/geometry/ @martinjrobins @rtimms @tinosulzer
/pybamm/input/ @brosaplanella @DrSOKane @rtimms @tinosulzer @TomTranter @kratman
/pybamm/meshes/ @martinjrobins @rtimms @tinosulzer @rtimms
/pybamm/models/ @brosaplanella @DrSOKane @rtimms @tinosulzer @TomTranter @rtimms
/pybamm/parameters/ @brosaplanella @DrSOKane @rtimms @tinosulzer @TomTranter @rtimms @kratman
/pybamm/plotting/ @martinjrobins @rtimms @Saransh-cpp @tinosulzer @rtimms @kratman @agriyakhetarpal
/pybamm/solvers/ @martinjrobins @rtimms @tinosulzer @TomTranter @rtimms
/pybamm/spatial_methods/ @martinjrobins @rtimms @tinosulzer @rtimms
/pybamm/discretisations/ @martinjrobins @rtimms @valentinsulzer
/pybamm/experiment/ @brosaplanella @martinjrobins @rtimms @valentinsulzer @TomTranter
/pybamm/expression_tree/ @martinjrobins @rtimms @valentinsulzer
/pybamm/geometry/ @martinjrobins @rtimms @valentinsulzer
/pybamm/input/ @brosaplanella @DrSOKane @rtimms @valentinsulzer @TomTranter @kratman
/pybamm/meshes/ @martinjrobins @rtimms @valentinsulzer @rtimms
/pybamm/models/ @brosaplanella @DrSOKane @rtimms @valentinsulzer @TomTranter @rtimms
/pybamm/parameters/ @brosaplanella @DrSOKane @rtimms @valentinsulzer @TomTranter @rtimms @kratman
/pybamm/plotting/ @martinjrobins @rtimms @Saransh-cpp @valentinsulzer @rtimms @kratman @agriyakhetarpal
/pybamm/solvers/ @martinjrobins @rtimms @valentinsulzer @TomTranter @rtimms
/pybamm/spatial_methods/ @martinjrobins @rtimms @valentinsulzer @rtimms
/pybamm/* @pybamm-team/maintainers # the files directly under /pybamm/, will not recurse

# CI/CD workflows
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body:
id: reproduce
attributes:
label: Steps to Reproduce
description: Tell us how to reproduce this behaviour. Ideally, this should take the form of a [Minimum Workable Example](https://stackoverflow.com/help/minimal-reproducible-example)
description: Tell us how to reproduce this behaviour. Ideally, this should include a code block which produces the error. Strive to make this example as small and simple as possible. It should contain the code required to reproduce the error, and no additional code. For example, if your code includes lines to run a simulation, then lines to plot the results, and the lines to run the simulation fail, only include those lines (and not the plotting lines, which are irrelevant). Often, the act of simplifying code to pinpoint errors can help you find bugs in your own code. For more information, see [these references](https://en.wikipedia.org/wiki/Minimal_reproducible_example#External_links)
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lychee_url_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

# use stable version for now to avoid breaking changes
- name: Lychee URL checker
uses: lycheeverse/lychee-action@v1.9.3
uses: lycheeverse/lychee-action@v1.10.0
with:
# arguments with file types to check
args: >-
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ jobs:
CMAKE_GENERATOR_PLATFORM=x64
CMAKE_BUILD_PARALLEL_LEVEL=${{ steps.get_num_cores.outputs.count }}
CIBW_ARCHS: AMD64
CIBW_BEFORE_BUILD: python -m pip install setuptools wheel # skip CasADi and CMake
CIBW_BEFORE_BUILD: python -m pip install setuptools wheel delvewheel # skip CasADi and CMake
CIBW_REPAIR_WHEEL_COMMAND: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"

- name: Upload Windows wheels
Expand Down
233 changes: 180 additions & 53 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:
pull_request:
branches:
- main
- main

# Run every day at 3 am UTC
schedule:
Expand All @@ -24,65 +24,50 @@ concurrency:
cancel-in-progress: true

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Check style
run: |
python -m pip install pre-commit
pre-commit run -a
build:
needs: style
run_unit_tests:
name: Unit tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
# Include macOS M1 runners
include:
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.11"
- os: macos-14
# Exclude Python 3.12 from unit tests since we run it in the coverage jobs
exclude:
- os: ubuntu-latest
python-version: "3.12"

steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev graphviz pandoc
sudo apt install texlive-full
sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng
- name: Install macOS system dependencies
if: matrix.os == 'macos-12' || matrix.os == 'macos-14'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_COLOR: 1
# Speed up CI
NONINTERACTIVE: 1
# sometimes gfortran cannot be found, so reinstall gcc just to be sure
run: |
brew analytics off
brew install graphviz libomp
brew reinstall gcc
- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz --version=2.38.0.20190211
run: choco install graphviz --version=8.0.5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install nox
run: python -m pip install nox
Expand All @@ -92,43 +77,183 @@ jobs:
if: matrix.os != 'windows-latest'
run: python -m nox -s pybamm-requires

- name: Run unit tests for GNU/Linux, macOS, and Windows with all Python versions
if: (matrix.os == 'ubuntu-latest' && matrix.python-version != 3.11) || (matrix.os != 'ubuntu-latest')
- name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }}
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
check_coverage:
runs-on: ubuntu-latest
name: Coverage tests (ubuntu-latest / Python 3.12)

steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4

- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install nox
run: python -m pip install nox

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

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

- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
uses: codecov/[email protected]
uses: codecov/[email protected]
if: github.repository == 'pybamm-team/PyBaMM'
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run integration tests
run: python -m nox -s integration
run_integration_tests:
name: Integration tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4

- name: Install docs dependencies and run doctests
- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng
- name: Install macOS system dependencies
if: matrix.os == 'macos-12' || matrix.os == 'macos-14'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_COLOR: 1
# Speed up CI
NONINTERACTIVE: 1
# sometimes gfortran cannot be found, so reinstall gcc just to be sure
run: |
brew analytics off
brew install graphviz
brew reinstall gcc
- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz --version=8.0.5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install nox
run: python -m pip install nox

- name: Install SuiteSparse and SUNDIALS on GNU/Linux and macOS
timeout-minutes: 10
if: matrix.os != 'windows-latest'
run: python -m nox -s pybamm-requires

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

# Skips IDAKLU module compilation for speedups, which is already tested in other jobs.
run_doctests:
runs-on: ubuntu-latest
name: Doctests (ubuntu-latest / Python 3.11)
steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install graphviz pandoc libopenblas-dev texlive-latex-extra dvipng
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install nox
run: python -m pip install nox

- name: Install docs dependencies and run doctests for GNU/Linux
run: python -m nox -s doctests

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

- name: Install dev dependencies and run example tests
if: matrix.os == 'ubuntu-latest'
run_example_tests:
runs-on: ubuntu-latest
name: Example notebooks (ubuntu-latest / Python 3.12)

steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4

- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran gcc graphviz pandoc libopenblas-dev texlive-latex-extra dvipng
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install nox
run: python -m pip install nox

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

- name: Run example notebooks tests for GNU/Linux with Python 3.12
run: python -m nox -s examples

- name: Run example scripts tests
if: matrix.os == 'ubuntu-latest'
run_scripts_tests:
runs-on: ubuntu-latest
name: Example scripts (ubuntu-latest / Python 3.12)

steps:
- name: Check out PyBaMM repository
uses: actions/checkout@v4

- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt install gfortran gcc graphviz libopenblas-dev texlive-latex-extra dvipng
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install nox
run: python -m pip install nox

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

- name: Run example scripts tests for GNU/Linux with Python 3.12
run: python -m nox -s scripts

# M-series Mac Mini
build-apple-mseries:
if: github.repository_owner == 'pybamm-team'
needs: style
runs-on: [self-hosted, macOS, ARM64]
env:
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
Expand All @@ -139,7 +264,9 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Check out PyBaMM repository
uses: actions/checkout@v4

- name: Install Python & create virtualenv
shell: bash
run: |
Expand Down
Loading

0 comments on commit 4077c31

Please sign in to comment.