Skip to content

Commit

Permalink
fixed merge conflict in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSOKane committed Jan 18, 2024
2 parents 78f13f9 + 40be4bc commit 14820f0
Show file tree
Hide file tree
Showing 45 changed files with 1,283 additions and 852 deletions.
12 changes: 12 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,18 @@
"contributions": [
"code"
]
},
{
"login": "AlessioBugetti",
"name": "Alessio Bugetti",
"avatar_url": "https://avatars.githubusercontent.com/u/38499721?v=4",
"profile": "https://github.com/AlessioBugetti",
"contributions": [
"infra",
"code",
"doc",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/release_reminder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create {{ date | date('YY.MM') }} (final or rc0) release
labels: priority:high
labels: "priority: high"
---
Quarterly reminder to create a -

Expand Down
8 changes: 4 additions & 4 deletions .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub, P

## rcX releases (manual)

If a new release candidate is required after the release of `rc0` -
If a new release candidate is required after the release of `rc{X-1}` -

1. Fix a bug in `vYY.MM` (no new features should be added to `vYY.MM` once `rc0` is released) and `develop` individually.
1. Cherry-pick the bug fix (no new features should be added to `vYY.MM` once `rc{X-1}` is released) commit to `vYY.MM` branch once the fix is merged into `develop`. The CHANGELOG entry for such fixes should go under the `rc{X-1}` heading in `CHANGELOG.md`

2. Run `update_version.yml` manually while using `append_to_tag` to specify the release candidate version number (`rc1`, `rc2`, ...).

Expand All @@ -36,7 +36,7 @@ If a new release candidate is required after the release of `rc0` -
- `vcpkg.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing `vYY.MM` branch and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).
These changes will be automatically pushed to the existing `vYY.MM` branch and a PR will be created to update version strings in `develop`.

4. Create a new GitHub _pre-release_ with the same tag (`vYY.MMrcX`) from the `vYY.MM` branch and a description copied from `CHANGELOG.md`.

Expand All @@ -57,7 +57,7 @@ Once satisfied with the release candidates -
- `vcpkg.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing `vYY.MM` branch and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).
These changes will be automatically pushed to the existing `vYY.MM` branch and a PR will be created to update version strings in `develop`.

3. Next, a PR from `vYY.MM` to `main` will be generated that should be merged once all the tests pass.

Expand Down
2 changes: 1 addition & 1 deletion .github/wheel_failure.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Fortnightly build for wheels failed
labels: priority:high, bug
labels: "priority: high, bug"
---

The build is failing with the following logs - {{ env.LOGS }}
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.8.0
uses: lycheeverse/lychee-action@v1.9.1
with:
# arguments with file types to check
args: >-
Expand Down
81 changes: 56 additions & 25 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,37 @@ on:
required: false
default: false

# Set options available for all jobs that use cibuildwheel
env:
# Increase pip debugging output, equivalent to `pip -vv`
CIBW_BUILD_VERBOSITY: 2
# Disable build isolation to allow pre-installing build-time dependencies.
# Note: CIBW_BEFORE_BUILD must be present in all jobs using cibuildwheel.
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
# Skip PyPy and MUSL builds in any and all jobs
CIBW_SKIP: "pp* *musllinux*"
FORCE_COLOR: 3

jobs:
build_windows_wheels:
name: Build wheels on windows-latest
name: Wheels (windows-latest)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Get number of cores on Windows
id: get_num_cores
shell: python
run: |
from os import environ, cpu_count
num_cpus = cpu_count()
output_file = environ['GITHUB_OUTPUT']
with open(output_file, "a", encoding="utf-8") as output_stream:
output_stream.write(f"count={num_cpus}\n")
- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.11.1 https://github.com/pybind/pybind11.git

Expand Down Expand Up @@ -53,8 +74,17 @@ jobs:
- name: Build 64-bit wheels on Windows
run: pipx run cibuildwheel --output-dir wheelhouse
env:
CIBW_ENVIRONMENT: 'PYBAMM_USE_VCPKG=ON VCPKG_ROOT_DIR=C:\vcpkg VCPKG_DEFAULT_TRIPLET=x64-windows-static-md VCPKG_FEATURE_FLAGS=manifests,registries CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64'
CIBW_ARCHS: "AMD64"
CIBW_ENVIRONMENT: >
PYBAMM_USE_VCPKG=ON
VCPKG_ROOT_DIR=C:\vcpkg
VCPKG_DEFAULT_TRIPLET=x64-windows-static-md
VCPKG_FEATURE_FLAGS=manifests,registries
CMAKE_GENERATOR="Visual Studio 17 2022"
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_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"

- name: Upload Windows wheels
uses: actions/upload-artifact@v4
Expand All @@ -63,16 +93,19 @@ jobs:
path: ./wheelhouse/*.whl
if-no-files-found: error

build_wheels:
name: Build wheels on ${{ matrix.os }}
build_macos_and_linux_wheels:
name: Wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
name: Check out PyBaMM repository

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

Expand All @@ -88,26 +121,26 @@ jobs:
python -m pip install cmake wget
python scripts/install_KLU_Sundials.py
- name: Build wheels on ${{ matrix.os }}
- name: Build wheels on Linux
run: pipx run cibuildwheel --output-dir wheelhouse
if: matrix.os == 'ubuntu-latest'
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: >
yum -y install openblas-devel lapack-devel &&
bash scripts/install_sundials.sh 6.0.3 6.5.0
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install cmake casadi numpy
# override; point to casadi install path so that it can be found by the repair command
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$(python -c 'import casadi; print(casadi.__path__[0])')" auditwheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_BUILD_LINUX: python -m pip install cmake casadi setuptools wheel
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"

- name: Build wheels on macOS
if: matrix.os == 'macos-latest'
run: pipx run cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD_MACOS: >
python -m pip
install cmake casadi numpy &&
python scripts/fix_casadi_rpath_mac.py && scripts/fix_suitesparse_rpath_mac.sh
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
delocate-listdeps {wheel} &&
delocate-wheel -v -w {dest_dir} {wheel}
CIBW_SKIP: "pp* *musllinux*"
python -m pip install --upgrade cmake casadi setuptools wheel
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"

- name: Upload wheels for Linux
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -135,9 +168,6 @@ jobs:
with:
python-version: 3.12

- name: Install dependencies
run: pip install --upgrade pip setuptools wheel

- name: Build SDist
run: pipx run build --sdist

Expand All @@ -149,9 +179,10 @@ jobs:
if-no-files-found: error

publish_pypi:
if: github.event_name != 'schedule' && github.repository_owner == 'pybamm-team'
# This job is only of value to PyBaMM and would always be skipped in forks
if: github.event_name != 'schedule' && github.repository == 'pybamm-team/PyBaMM'
name: Upload package to PyPI
needs: [build_wheels, build_windows_wheels, build_sdist]
needs: [build_macos_and_linux_wheels, build_windows_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand Down Expand Up @@ -180,9 +211,9 @@ jobs:
repository-url: https://test.pypi.org/legacy/

open_failure_issue:
needs: [build_windows_wheels, build_wheels, build_sdist]
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_sdist]
name: Open an issue if build fails
if: ${{ always() && contains(needs.*.result, 'failure') }}
if: ${{ always() && contains(needs.*.result, 'failure') && github.repository_owner == 'pybamm-team'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
50 changes: 48 additions & 2 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
- name: Check style
run: |
python -m pip install pre-commit
git add .
pre-commit run ruff
pre-commit run -a
build:
needs: style
Expand Down Expand Up @@ -153,3 +152,50 @@ jobs:
eval "$(pyenv init -)"
pyenv activate pybamm-${{ matrix.python-version }}
pyenv uninstall -f $( python --version )
test_install_odes:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false
name: Test pybamm_install_odes on ${{ matrix.os }}

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

- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install gfortran gcc libopenblas-dev
- name: Install macOS system dependencies
if: matrix.os == 'macos-latest'
env:
# Homebrew environment variables
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_COLOR: 1
# Speed up CI
NONINTERACTIVE: 1
run: |
brew analytics off
brew install openblas
brew reinstall gcc gfortran
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install PyBaMM
run: python -m pip install -e .

- name: Test pybamm_install_odes on ${{ matrix.os }}
run: |
python -m pip cache purge
python -m pip install wget cmake
pybamm_install_odes
18 changes: 6 additions & 12 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- name: Check style
run: |
python -m pip install pre-commit
git add .
pre-commit run ruff
pre-commit run -a
run_unit_tests:
needs: style
Expand Down Expand Up @@ -106,8 +105,7 @@ jobs:
# Headers and dynamic library files for SuiteSparse and SUNDIALS
${{ env.HOME }}/.local/lib/
${{ env.HOME }}/.local/include/
${{ env.HOME }}/.local/examples/
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py') }}
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux and macOS
if: matrix.os != 'windows-latest'
Expand Down Expand Up @@ -163,8 +161,7 @@ jobs:
# Headers and dynamic library files for SuiteSparse and SUNDIALS
${{ env.HOME }}/.local/lib/
${{ env.HOME }}/.local/include/
${{ env.HOME }}/.local/examples/
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py') }}
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
run: python -m nox -s pybamm-requires
Expand Down Expand Up @@ -245,8 +242,7 @@ jobs:
# Headers and dynamic library files for SuiteSparse and SUNDIALS
${{ env.HOME }}/.local/lib/
${{ env.HOME }}/.local/include/
${{ env.HOME }}/.local/examples/
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py') }}
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux and macOS
if: matrix.os != 'windows-latest'
Expand Down Expand Up @@ -344,8 +340,7 @@ jobs:
# Headers and dynamic library files for SuiteSparse and SUNDIALS
${{ env.HOME }}/.local/lib/
${{ env.HOME }}/.local/include/
${{ env.HOME }}/.local/examples/
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py') }}
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }}

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
run: python -m nox -s pybamm-requires
Expand Down Expand Up @@ -399,8 +394,7 @@ jobs:
# Headers and dynamic library files for SuiteSparse and SUNDIALS
${{ env.HOME }}/.local/lib/
${{ env.HOME }}/.local/include/
${{ env.HOME }}/.local/examples/
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py') }}
key: nox-${{ matrix.os }}-pybamm-requires-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/install_KLU_Sundials.py', '**/noxfile.py', '**/test_on_push.yml') }}

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

0 comments on commit 14820f0

Please sign in to comment.