Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:akhilender-bongirwar/PyBaMM into…
Browse files Browse the repository at this point in the history
… enhancement/activate-venv-dev-nox
  • Loading branch information
akhilender-bongirwar committed Oct 6, 2023
2 parents 42c6c55 + d02a78b commit d2b51ff
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 71 deletions.
25 changes: 15 additions & 10 deletions .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub an

## rc0 releases (automated)

1. The `update_version.yml` workflow will run on every 1st of January, May and September, updating incrementing the version to `YY.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.MMrc0` by running `scripts/update_version.py` in the following files -

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

These changes will be automatically pushed to a new branch `YY.MM`.
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).

2. Create a new GitHub _pre-release_ with the tag `YY.MMrc0` from the `YY.MM` branch and a description copied from `CHANGELOG.md`.
2. Create a new GitHub _pre-release_ with the tag `vYY.MMrc0` 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.

## rcX releases (manual)

If a new release candidate is required after the release of `rc0` -

1. Fix a bug in `YY.MM` (no new features should be added to `YY.MM` once `rc0` is released) and `develop` individually.
1. Fix a bug in `vYY.MM` (no new features should be added to `vYY.MM` once `rc0` is released) and `develop` individually.

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

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

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -36,9 +36,9 @@ If a new release candidate is required after the release of `rc0` -
- `docs/_static/versions.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing branch `YY.MM`.
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).

4. Create a new GitHub _pre-release_ with the same tag (`YY.MMrcX`) from the `YY.MM` branch and a description copied from `CHANGELOG.md`.
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`.

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

Expand All @@ -48,7 +48,7 @@ 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 `YY.MMrcX` by running `scripts/update_version.py` in the following files -
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`
Expand All @@ -57,9 +57,9 @@ Once satisfied with the release candidates -
- `docs/_static/versions.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing branch `YY.MM`.
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).

3. Next, a PR from `YY.MM` to `main` will be generated that should be merged once all the tests pass.
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`.

Expand All @@ -72,3 +72,8 @@ 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 `setup.py`, fixing any bugs that arise
- Make sure the URLs in `docs/_static/versions.json` are valid
- 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 origin <tag_name> # can only be carried out by the maintainers
```
18 changes: 9 additions & 9 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ jobs:
- name: Build wheels on Linux and MacOS
run: python -m cibuildwheel --output-dir wheelhouse
env:
# TODO: openblas no longer available on centos 7 i686 image, use blas instead for now
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: >
yum -y install blas-devel lapack-devel &&
bash build_manylinux_wheels/install_sundials.sh 5.8.1 6.5.0
yum -y install openblas-devel lapack-devel &&
bash build_manylinux_wheels/install_sundials.sh 6.0.3 6.5.0
CIBW_BEFORE_BUILD_LINUX: "python -m pip install cmake casadi numpy"
CIBW_BEFORE_BUILD_MACOS: >
Expand Down Expand Up @@ -135,13 +135,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

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

- name: Build sdist
run: python setup.py sdist --formats=gztar
run: python -m build --sdist

- name: Upload sdist
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -171,13 +171,13 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: files/
packages-dir: files/

- name: Publish on TestPyPI
if: github.event.inputs.target == 'testpypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
packages_dir: files/
repository_url: https://test.pypi.org/legacy/
packages-dir: files/
repository-url: https://test.pypi.org/legacy/
10 changes: 10 additions & 0 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@ jobs:
with:
message: 'Bump to ${{ env.VERSION }}'

- name: Make a PR from ${{ env.NON_RC_VERSION }} to develop
uses: repo-sync/pull-request@v2
with:
source_branch: '${{ env.NON_RC_VERSION }}'
destination_branch: "develop"
pr_title: "Sync ${{ env.NON_RC_VERSION }} and develop"
pr_body: "**Merge as soon as possible to avoid potential conflicts.**"
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Make a PR from ${{ env.NON_RC_VERSION }} to main
id: release_pr
if: github.event_name == 'workflow_dispatch' && !startsWith(github.event.inputs.append_to_tag, 'rc')
uses: repo-sync/pull-request@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

# [v23.9rc0](https://github.com/pybamm-team/PyBaMM/tree/v23.9rc0) - 2023-10-31

## Features
- The parameter "Ambient temperature [K]" can now be given as a function of position `(y,z)` and time `t`. The "edge" and "current collector" heat transfer coefficient parameters can also depend on `(y,z)` ([#3257](https://github.com/pybamm-team/PyBaMM/pull/3257))
- Spherical and cylindrical shell domains can now be solved with any boundary conditions ([#3237](https://github.com/pybamm-team/PyBaMM/pull/3237))
Expand Down Expand Up @@ -42,6 +44,7 @@

## Breaking changes

- Dropped support for i686 (32-bit) architectures on GNU/Linux distributions ([#3412](https://github.com/pybamm-team/PyBaMM/pull/3412))
- The class `pybamm.thermal.OneDimensionalX` has been moved to `pybamm.thermal.pouch_cell.OneDimensionalX` to reflect the fact that the model formulation implicitly assumes a pouch cell geometry ([#3257](https://github.com/pybamm-team/PyBaMM/pull/3257))
- The "lumped" thermal option now always used the parameters "Cell cooling surface area [m2]", "Cell volume [m3]" and "Total heat transfer coefficient [W.m-2.K-1]" to compute the cell cooling regardless of the chosen "cell geometry" option. The user must now specify the correct values for these parameters instead of them being calculated based on e.g. a pouch cell. An `OptionWarning` is raised to let users know to update their parameters ([#3257](https://github.com/pybamm-team/PyBaMM/pull/3257))
- Numpy functions now work with PyBaMM symbols (e.g. `np.exp(pybamm.Symbol("a"))` returns `pybamm.Exp(pybamm.Symbol("a"))`). This means that parameter functions can be specified using numpy functions instead of pybamm functions. Additionally, combining numpy arrays with pybamm objects now works (the numpy array is converted to a pybamm array) ([#3205](https://github.com/pybamm-team/PyBaMM/pull/3205))
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.5"
version: "23.9rc0"
repository-code: "https://github.com/pybamm-team/PyBaMM"
title: "Python Battery Mathematical Modelling (PyBaMM)"
4 changes: 2 additions & 2 deletions build_manylinux_wheels/install_sundials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ yum -y install openblas-devel

mkdir -p build_sundials
cd build_sundials
KLU_INCLUDE_DIR=/usr/include
KLU_LIBRARY_DIR=/usr/lib
KLU_INCLUDE_DIR=/usr/local/include
KLU_LIBRARY_DIR=/usr/local/lib
SUNDIALS_DIR=sundials-$SUNDIALS_VERSION
cmake -DENABLE_LAPACK=ON\
-DSUNDIALS_INDEX_SIZE=32\
Expand Down
22 changes: 11 additions & 11 deletions docs/source/examples/notebooks/models/SEI-on-cracks.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit d2b51ff

Please sign in to comment.