Skip to content

Commit

Permalink
Merge pull request #4408 from kratman/release/v24.9.0
Browse files Browse the repository at this point in the history
Release v24.9.0
  • Loading branch information
kratman authored Sep 3, 2024
2 parents d026075 + c212bb0 commit 0e50894
Show file tree
Hide file tree
Showing 573 changed files with 9,980 additions and 7,875 deletions.
20 changes: 20 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,26 @@
"contributions": [
"code"
]
},
{
"login": "MehrdadBabazadeh",
"name": "Mehrdad Babazadeh",
"avatar_url": "https://avatars.githubusercontent.com/u/30574522?v=4",
"profile": "https://github.com/MehrdadBabazadeh",
"contributions": [
"code",
"test"
]
},
{
"login": "pipliggins",
"name": "Pip Liggins",
"avatar_url": "https://avatars.githubusercontent.com/u/55396775?v=4",
"profile": "https://github.com/pipliggins",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
24 changes: 12 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Automatically request reviews from maintainers

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

# CI/CD workflows
/.github/ @martinjrobins @Saransh-cpp @agriyakhetarpal @kratman @arjxn-py
Expand Down
97 changes: 51 additions & 46 deletions .github/release_workflow.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Release workflow

This file contains the workflow required to make a `PyBaMM` release on GitHub, PyPI, and conda-forge 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)
## Initial release (automated)

1. The `update_version.yml` workflow will run on every 1st of January, May and September, updating incrementing the version to `vYY.MMrc0` by running `scripts/update_version.py` in the following files -
1. The `update_version.yml` workflow will run on every 1st of January, May
and September, updating incrementing the version to `vYY.MM.0` by running
`scripts/update_version.py` in the following files:

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -13,21 +16,27 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub, P
- `vcpkg.json`
- `CHANGELOG.md`

These changes will be automatically pushed to a new branch `vYY.MM` and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).
These changes will be automatically pushed to a new branch `vYY.MM`
and a PR from `vYY.MM` to `main` will be created.

2. Create a new GitHub _pre-release_ with the tag `vYY.MMrc0` from the `vYY.MM` branch and a description copied from `CHANGELOG.md`.
2. Create a new GitHub _release_ with the tag `vYY.MM.0` from the `vYY.MM`
branch and a description copied from `CHANGELOG.md`.

3. This release will automatically trigger `publish_pypi.yml` and create a _pre-release_ on PyPI.
3. This release will automatically trigger `publish_pypi.yml` and create a
_release_ on PyPI.

## rcX releases (manual)
## Bug fix releases (manual)

If a new release candidate is required after the release of `rc{X-1}` -
If a new release is required after the release of `vYY.MM.{x-1}` -

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`
1. Create a new branch for the `vYY.MM.x` release using the `vYY.MM.{x-1}` tag.

2. Run `update_version.yml` manually while using `append_to_tag` to specify the release candidate version number (`rc1`, `rc2`, ...).
2. Cherry-pick the bug fixes to `vYY.MM.x` branch once the fix is
merged into `develop`. The CHANGELOG entry for such fixes should go under the
`YY.MM.x` heading in `CHANGELOG.md`

3. This will increment the version to `vYY.MMrcX` by running `scripts/update_version.py` in the following files -
3. Run `scripts/update_version.py` manually while setting `VERSION=vYY.MM.x`
in your environment. This will update the version in the following files:

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -36,45 +45,41 @@ If a new release candidate is required after the release of `rc{X-1}` -
- `vcpkg.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing `vYY.MM` branch and a PR will be created to update version strings in `develop`.
Commit the changes to your release branch.

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`.
4. Create a PR for the release and configure it to merge into the `main` branch.

5. This release will automatically trigger `publish_pypi.yml` and create a _pre-release_ on PyPI.

## Actual release (manual)

Once satisfied with the release candidates -

1. Run `update_version.yml` manually, leaving the `append_to_tag` field blank ("") for an actual release.

2. This will increment the version to `vYY.MMrcX` by running `scripts/update_version.py` in the following files -

- `pybamm/version.py`
- `docs/conf.py`
- `CITATION.cff`
- `pyproject.toml`
- `vcpkg.json`
- `CHANGELOG.md`

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.

4. Create a new GitHub _release_ with the same tag from the `main` branch and a description copied from `CHANGELOG.md`.

5. This release will automatically trigger `publish_pypi.yml` and create a _release_ on PyPI.
5. Create a new GitHub release with the same tag (`YY.MM.x`) from the `main`
branch and a description copied from `CHANGELOG.md`. This release will
automatically trigger `publish_pypi.yml` and create a _release_ on PyPI.

## Other checks

Some other essential things to check throughout the release process -

- If updating our custom vcpkg registory entries [pybamm-team/sundials-vcpkg-registry](https://github.com/pybamm-team/sundials-vcpkg-registry) or [pybamm-team/casadi-vcpkg-registry](https://github.com/pybamm-team/casadi-vcpkg-registry) (used to build Windows wheels), make sure to update the baseline of the registories in vcpkg-configuration.json to the latest commit id.
- Update jax and jaxlib to the latest version in `pybamm.util` and `pyproject.toml`, fixing any bugs that arise
- As the release workflow is initiated by the `release` event, it's important to note that the default `GITHUB_REF` used by `actions/checkout` during the checkout process will correspond to the tag created during the release process. Consequently, the workflows will consistently build PyBaMM based on the commit associated with this tag. Should new commits be introduced to the `vYY.MM` branch, such as those addressing build issues, it becomes necessary to manually update this tag to point to the most recent commit -
```
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.
- If updating our custom vcpkg registry entries
[sundials-vcpkg-registry][SUNDIALS_VCPKG]
or [casadi-vcpkg-registry][CASADI_VCPKG] (used to build Windows
wheels), make sure to update the baseline of the registries in
vcpkg-configuration.json to the latest commit id.
- Update jax and jaxlib to the latest version in `pybamm.util` and
`pyproject.toml`, fixing any bugs that arise.
- 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 [pybamm-feedstock][PYBAMM_FEED] repository accordingly by
following the instructions in the [conda-forge documentation][FEED_GUIDE] 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.

[SUNDIALS_VCPKG]: https://github.com/pybamm-team/sundials-vcpkg-registry
[CASADI_VCPKG]: https://github.com/pybamm-team/casadi-vcpkg-registry
[PYBAMM_FEED]: https://github.com/conda-forge/pybamm-feedstock
[FEED_GUIDE]: https://conda-forge.org/docs/maintainer/updating_pkgs.html#updating-the-feedstock-repository
7 changes: 5 additions & 2 deletions .github/workflows/benchmark_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
sudo apt-get update
sudo apt install gfortran gcc libopenblas-dev
- name: Set up uv
run: python -m pip install uv

- name: Install python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy
python -m pip install asv[virtualenv]
python -m uv pip install --upgrade pip wheel setuptools wget cmake casadi numpy
python -m uv pip install asv[virtualenv]
- name: Install SuiteSparse and SUNDIALS
run: python scripts/install_KLU_Sundials.py
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/periodic_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ jobs:
sudo apt-get update
sudo apt-get install gfortran gcc libopenblas-dev
- name: Set up uv
run: python -m pip install uv

- name: Install python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy
python -m pip install asv[virtualenv]
python -m uv pip install --upgrade pip wheel setuptools wget cmake casadi numpy
python -m uv pip install asv[virtualenv]
- name: Install SuiteSparse and SUNDIALS
run: python scripts/install_KLU_Sundials.py
Expand All @@ -48,7 +51,7 @@ jobs:
LD_LIBRARY_PATH: $HOME/.local/lib

- name: Upload results as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: asv_periodic_results
path: results
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ jobs:
CMAKE_BUILD_PARALLEL_LEVEL=${{ steps.get_num_cores.outputs.count }}
CIBW_ARCHS: AMD64
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; print(pybamm.IDAKLUSolver())"

# Fix access violation because GHA runners have modified PATH that picks wrong
# msvcp140.dll, see https://github.com/adang1345/delvewheel/issues/54
CIBW_REPAIR_WHEEL_COMMAND: delvewheel repair --add-path C:/Windows/System32 -w {dest_dir} {wheel}
CIBW_TEST_EXTRAS: "all,dev,jax"
CIBW_TEST_COMMAND: |
python -c "import pybamm; print(pybamm.IDAKLUSolver())"
python -m pytest -m cibw {project}/tests/unit
- name: Upload Windows wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: wheels_windows
path: ./wheelhouse/*.whl
Expand Down Expand Up @@ -118,12 +122,14 @@ jobs:
bash scripts/install_sundials.sh 6.0.3 6.5.0
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_EXTRAS: "all,dev,jax"
CIBW_TEST_COMMAND: |
set -e -x
python -c "import pybamm; print(pybamm.IDAKLUSolver())"
python -m pytest -m cibw {project}/tests/unit
- name: Upload wheels for Linux
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: wheels_manylinux
path: ./wheelhouse/*.whl
Expand All @@ -145,9 +151,6 @@ jobs:
- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.12.0 https://github.com/pybind/pybind11.git -c advice.detachedHead=false

- name: Set macOS-specific environment variables
run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV

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

Expand Down Expand Up @@ -239,22 +242,26 @@ jobs:
python scripts/install_KLU_Sundials.py
python -m cibuildwheel --output-dir wheelhouse
env:
# 10.13 for Intel (macos-12/macos-13), 11.0 for Apple Silicon (macos-14 and macos-latest)
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '11.0' || '10.13' }}
CIBW_ARCHS_MACOS: auto
CIBW_BEFORE_BUILD: python -m pip install cmake casadi setuptools wheel delocate
CIBW_REPAIR_WHEEL_COMMAND: |
if [[ $(uname -m) == "x86_64" ]]; then
delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
elif [[ $(uname -m) == "arm64" ]]; then
# Use higher macOS target for now: https://github.com/casadi/casadi/issues/3698
# Use higher macOS target for now since casadi/libc++.1.0.dylib is still not fixed
delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel} --require-target-macos-version 11.1
for file in {dest_dir}/*.whl; do mv "$file" "${file//macosx_11_1/macosx_11_0}"; done
fi
CIBW_TEST_EXTRAS: "all,dev,jax"
CIBW_TEST_COMMAND: |
set -e -x
python -c "import pybamm; print(pybamm.IDAKLUSolver())"
python -m pytest -m cibw {project}/tests/unit
- name: Upload wheels for macOS (amd64, arm64)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: wheels_${{ matrix.os }}
path: ./wheelhouse/*.whl
Expand All @@ -274,7 +281,7 @@ jobs:
run: pipx run build --sdist

- name: Upload SDist
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: sdist
path: ./dist/*.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_benchmarks_over_history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
${{ github.event.inputs.commit_start }}..${{ github.event.inputs.commit_end }}
- name: Upload results as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.6
with:
name: asv_over_history_results
path: results
Expand Down
Loading

0 comments on commit 0e50894

Please sign in to comment.