Skip to content

Commit

Permalink
Merge pull request #2821 from pybamm-team/develop
Browse files Browse the repository at this point in the history
Make release v23.3
  • Loading branch information
brosaplanella committed Apr 1, 2023
2 parents 4a7e409 + 08dc8f7 commit 2c4bcea
Show file tree
Hide file tree
Showing 368 changed files with 12,516 additions and 13,675 deletions.
23 changes: 22 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@
"avatar_url": "https://avatars.githubusercontent.com/u/83979298?v=4",
"profile": "https://github.com/jeromtom",
"contributions": [
"doc"
"doc",
"code",
"test"
]
},
{
Expand All @@ -590,6 +592,25 @@
"contributions": [
"example"
]
},
{
"login": "jsbrittain",
"name": "jsbrittain",
"avatar_url": "https://avatars.githubusercontent.com/u/98161205?v=4",
"profile": "http://www.jsbrittain.com/",
"contributions": [
"code",
"test"
]
},
{
"login": "arjxn-py",
"name": "Arjun",
"avatar_url": "https://avatars.githubusercontent.com/u/104268427?v=4",
"profile": "https://github.com/arjxn-py",
"contributions": [
"infra"
]
}
],
"contributorsPerLine": 7,
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/lychee_url_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check URLs with Lychee

on:
push:
branches:
- main
- develop
pull_request:
schedule:
# Run everyday at 3 am UTC
- cron: "0 3 * * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:

# cache Lychee results to avoid hitting rate limits
- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

# check URLs with Lychee
- uses: actions/checkout@v3

# use stable version for now to avoid breaking changes
- name: Lychee URL checker
uses: lycheeverse/lychee-action@v1.6.1
with:
# arguments with file types to check
args: >-
--cache
--no-progress
--max-cache-age 2d
--timeout 10
--max-retries 5
--skip-missing
--exclude-loopback
--exclude https://twitter.com/pybamm_
--exclude "https://doi\.org|www.sciencedirect\.com/*"
--accept 200,429
--exclude-path ./CHANGELOG.md
--exclude-path ./scripts/update_version.py
'./**/*.rst'
'./**/*.md'
'./**/*.py'
'./**/*.ipynb'
# fail the action on broken links
fail: true
env:
# to be used in case rate limits are surpassed
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 0 additions & 34 deletions .github/workflows/url_checker.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dist/
coverage.xml
htmlcov/

# virtual enviroment
# virtual environment
env/
venv/
venv3.5/
Expand All @@ -74,6 +74,7 @@ lib64
share/
pyvenv.cfg
.vscode
.ruff_cache/

# sundials
sundials
Expand Down
17 changes: 17 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# a list of links/files to be ignored by lychee link checker (see workflow file)

# Errors in docs/source/user_guide/getting_started.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs

# Errors in docs/source/user_guide/fundamentals/index.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/base_battery_model
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/parameter_sets
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/quick_plot
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/plot_voltage_components

# Errors in docs/source/user_guide/index.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs

# Errors in examples/notebooks/README.md
file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/using-submodels.ipynb
file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/create-model.ipynb
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.253"
rev: "v0.0.259"
hooks:
- id: ruff
args: [--ignore=E741, --exclude=__init__.py]
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
20 changes: 0 additions & 20 deletions .readthedocs.yml

This file was deleted.

41 changes: 38 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,47 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

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

## Features

- Added option to limit the number of integrators stored in CasadiSolver, which is particularly relevant when running simulations back-to-back [#2823](https://github.com/pybamm-team/PyBaMM/pull/2823)
- Added new variables, related to electrode balance, for the `ElectrodeSOH` model ([#2807](https://github.com/pybamm-team/PyBaMM/pull/2807))
- Added method to calculate maximum theoretical energy. ([#2777](https://github.com/pybamm-team/PyBaMM/pull/2777)) and add to summary variables ([#2781](https://github.com/pybamm-team/PyBaMM/pull/2781))
- Renamed "Terminal voltage [V]" to just "Voltage [V]". "Terminal voltage [V]" can still be used and will return the same value as "Voltage [V]". ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
- Added "Negative electrode surface potential difference at separator interface [V]", which is the value of the surface potential difference (`phi_s - phi_e`) at the anode/separator interface, commonly controlled in fast-charging algorithms to avoid plating. Also added "Positive electrode surface potential difference at separator interface [V]". ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
- Added "Bulk open-circuit voltage [V]", which is the open-circuit voltage as calculated from the bulk particle concentrations. The old variable "Measured open circuit voltage [V]", which referred to the open-circuit potential as calculated from the surface particle concentrations, has been renamed to "Surface open-circuit voltage [V]". ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740)) "Bulk open-circuit voltage [V]" was briefly named "Open-circuit voltage [V]", but this was changed in ([#2845](https://github.com/pybamm-team/PyBaMM/pull/2845))
- Added an example for `plot_voltage_components`, explaining what the different voltage components are. ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))

## Bug fixes

- Fixed excessive RAM consumption when running multiple simulations ([#2823](https://github.com/pybamm-team/PyBaMM/pull/2823))
- 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

- Migrated to [Lychee](https://github.com/lycheeverse/lychee-action) workflow for checking URLs ([#2734](https://github.com/pybamm-team/PyBaMM/pull/2734))

## Breaking changes

- `ElectrodeSOH.solve` now returns a `{str: float}` dict instead of a `pybamm.Solution` object (to avoid having to do `.data[0]` every time). In any code that uses `sol = ElectrodeSOH.solve()`, `sol[key].data[0]` should be replaced with `sol[key]`. ([#2779](https://github.com/pybamm-team/PyBaMM/pull/2779))
- Removed "... cation signed stoichiometry" and "... electrons in reaction" parameters, they are now hardcoded. ([#2778](https://github.com/pybamm-team/PyBaMM/pull/2778))
- When using `solver.step()`, the first time point in the step is shifted by `pybamm.settings.step_start_offset` (default 1 ns) to avoid having duplicate times in the solution steps from the end of one step and the start of the next. ([#2773](https://github.com/pybamm-team/PyBaMM/pull/2773))
- Renamed "Measured open circuit voltage [V]" to "Surface open-circuit voltage [V]". This variable was calculated from surface particle concentrations, and hence "hid" the overpotential from particle gradients. The new variable "Bulk open-circuit voltage [V]" is calculated from bulk particle concentrations instead. ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
- Renamed all references to "open circuit" to be "open-circuit" instead. ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
- Renamed parameter "1 + dlnf/dlnc" to "Thermodynamic factor". ([#2727](https://github.com/pybamm-team/PyBaMM/pull/2727))
- All PyBaMM models are now dimensional. This has been benchmarked against dimensionless models and found to give around the same solve time. Implementing dimensional models greatly reduces the barrier to entry for adding new models. However, this comes with several breaking changes: (i) the `timescale` and `length_scales` attributes of a model have been removed (they are no longer needed) (ii) several dimensionless variables are no longer defined, but the corresponding dimensional variables can still be accessed by adding the units to the name (iii) some parameters used only for non-dimensionalization, such as "Typical current [A]", have been removed ([#2419](https://github.com/pybamm-team/PyBaMM/pull/2419))

# [v23.2](https://github.com/pybamm-team/PyBaMM/tree/v23.2) - 2023-02-28

## Features

- Added an option for using a banded jacobian and sundials banded solvers for the IDAKLU solve [#2677](https://github.com/pybamm-team/PyBaMM/pull/2677)
- The "particle size" option can now be a tuple to allow different behaviour in each electrode([#2672](https://github.com/pybamm-team/PyBaMM/pull/2672)).
- Added temperature control to experiment class. [#2518](https://github.com/pybamm-team/PyBaMM/pull/2518)
- Added an option for using a banded jacobian and sundials banded solvers for the IDAKLU solve ([#2677](https://github.com/pybamm-team/PyBaMM/pull/2677))
- The "particle size" option can now be a tuple to allow different behaviour in each electrode ([#2672](https://github.com/pybamm-team/PyBaMM/pull/2672)).
- Added temperature control to experiment class. ([#2518](https://github.com/pybamm-team/PyBaMM/pull/2518))

## Bug fixes

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.2"
version: "23.3"
repository-code: "https://github.com/pybamm-team/PyBaMM"
title: "Python Battery Mathematical Modelling (PyBaMM)"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ Editable notebooks are made available using [Google Colab](https://colab.researc
GitHub does some magic with particular filenames. In particular:

- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/PyBaMM) displays the contents of [README.md](README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
- The license for using PyBaMM is stored in [LICENSE](LICENSE), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- The license for using PyBaMM is stored in [LICENSE](LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- This file, [CONTRIBUTING.md](CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.

## Acknowledgements
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-53-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-54-orange.svg)](#-contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

</div>
Expand Down Expand Up @@ -247,8 +247,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ayeankit"><img src="https://avatars.githubusercontent.com/u/72691866?v=4?s=100" width="100px;" alt="Ankit Kumar"/><br /><sub><b>Ankit Kumar</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=ayeankit" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://aniketsinghrawat.vercel.app/"><img src="https://avatars.githubusercontent.com/u/31622972?v=4?s=100" width="100px;" alt="Aniket Singh Rawat"/><br /><sub><b>Aniket Singh Rawat</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=dikwickley" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jeromtom"><img src="https://avatars.githubusercontent.com/u/83979298?v=4?s=100" width="100px;" alt="Jerom Palimattom Tom"/><br /><sub><b>Jerom Palimattom Tom</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=jeromtom" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jeromtom"><img src="https://avatars.githubusercontent.com/u/83979298?v=4?s=100" width="100px;" alt="Jerom Palimattom Tom"/><br /><sub><b>Jerom Palimattom Tom</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=jeromtom" title="Documentation">📖</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=jeromtom" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=jeromtom" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://bradyplanden.github.io"><img src="https://avatars.githubusercontent.com/u/55357039?v=4?s=100" width="100px;" alt="Brady Planden"/><br /><sub><b>Brady Planden</b></sub></a><br /><a href="#example-BradyPlanden" title="Examples">💡</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.jsbrittain.com/"><img src="https://avatars.githubusercontent.com/u/98161205?v=4?s=100" width="100px;" alt="jsbrittain"/><br /><sub><b>jsbrittain</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=jsbrittain" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=jsbrittain" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/arjxn-py"><img src="https://avatars.githubusercontent.com/u/104268427?v=4?s=100" width="100px;" alt="Arjun"/><br /><sub><b>Arjun</b></sub></a><br /><a href="#infra-arjxn-py" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>
Expand Down
17 changes: 10 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "The PyBaMM Team"

# The short X.Y version
version = "23.2"
version = "23.3"
# The full version, including alpha/beta/rc tags
release = version

Expand All @@ -50,6 +50,7 @@
"sphinx_design",
"sphinx_copybutton",
"myst_parser",
"sphinx_extend_parent",
]


Expand Down Expand Up @@ -135,12 +136,14 @@
"url": "https://github.com/pybamm-team/PyBaMM/tree/develop/CONTRIBUTING.md",
},
],
# Add light/dark mode and documentation version switcher:
# "navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
# "switcher": {
# "version_match": switcher_version,
# "json_url": "https://numpy.org/doc/_static/versions.json",
# },
"switcher": {
"version_match": release,
"json_url": "https://pybamm.readthedocs.io/en/latest/_static/versions.json", # noqa: E501
},
# turn to False to not fail build if json_url is not found
"check_switcher": True,
# for dark mode toggle, version switcher, and social media links
"navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
"use_edit_page_button": True,
}

Expand Down
15 changes: 7 additions & 8 deletions docs/source/_static/pybamm.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ h3 {

/* Style the active version button.
- dev: orange
- latest: orange
- stable: green
- old, PR: red
Expand All @@ -48,24 +48,23 @@ Wong, B. Points of view: Color blindness.
Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
*/

/* If the active version has the name "dev", style it orange */
#version_switcher_button[data-active-version-name*="dev"] {
/* If the active version has the name "latest", style it orange */
.version-switcher__button[data-active-version-name*="latest"] {
background-color: #e69f00;
border-color: #e69f00;
color: #000000;
}

/* green for `stable` */
#version_switcher_button[data-active-version-name*="stable"] {
.version-switcher__button[data-active-version-name*="stable"] {
background-color: #009e73;
border-color: #009e73;
}

/* red for `old` */
#version_switcher_button:not(
[data-active-version-name*="stable"],
[data-active-version-name*="dev"],
[data-active-version-name=""]
.version-switcher__button:not(
[data-active-version-name*="latest"],
[data-active-version-name*="stable"]
) {
background-color: #980f0f;
border-color: #980f0f;
Expand Down

0 comments on commit 2c4bcea

Please sign in to comment.