Skip to content

Commit

Permalink
Merge branch 'develop' into geometric-input-params
Browse files Browse the repository at this point in the history
  • Loading branch information
aabills authored Dec 20, 2024
2 parents c6de76f + f0f66da commit 8da3481
Show file tree
Hide file tree
Showing 63 changed files with 1,157 additions and 254 deletions.
13 changes: 11 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"skipCi": false,
"files": [
"all_contributors.md",
"all_contributors.md"
],
"imageSize": 100,
"commit": false,
Expand Down Expand Up @@ -999,14 +1000,22 @@
"contributions": [
"doc"
]
},
{
"login": "AndEsterson",
"name": "Andrew Esterson",
"avatar_url": "https://avatars.githubusercontent.com/u/55912083?v=4",
"profile": "https://github.com/AndEsterson",
"contributions": [
"infra"
]
}
],
"contributorsPerLine": 7,
"projectName": "PyBaMM",
"projectOwner": "pybamm-team",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true,
"commitConvention": "angular",
"commitType": "docs"
}
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0

- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
sarif_file: results.sarif
1 change: 0 additions & 1 deletion .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: PyBaMM
on:
workflow_dispatch:
pull_request:
paths-ignore: [".all-contributorsrc", "all_contributors.md"]

env:
PYBAMM_DISABLE_TELEMETRY: "true"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.2"
rev: "v0.8.3"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

## Features

- Made composite electrode model compatible with particle size distribution ([#4687](https://github.com/pybamm-team/PyBaMM/pull/4687))
- Added `Symbol.post_order()` method to return an iterable that steps through the tree in post-order fashion. ([#4684](https://github.com/pybamm-team/PyBaMM/pull/4684))
- Added two more submodels (options) for the SEI: Lars von Kolzenberg (2020) model and Tunneling Limit model ([#4394](https://github.com/pybamm-team/PyBaMM/pull/4394))


## Breaking changes

- Summary variables now calculated only when called, accessed via a class in the same manner as other variables rather than a dictionary. ([#4621](https://github.com/pybamm-team/PyBaMM/pull/4621))
- The conda distribution (`pybamm`) now installs all optional dependencies available on conda-forge. Use the new `pybamm-base` conda
package to install PyBaMM with only the required dependencies. ([conda-forge/pybamm-feedstock#70](https://github.com/conda-forge/pybamm-feedstock/pull/70))
- Separated extrapolation options for `pybamm.BoundaryValue` and `pybamm.BoundaryGradient`, and updated the default to be "linear" for the value and "quadratic" for the gradient. ([#4614](https://github.com/pybamm-team/PyBaMM/pull/4614))
Expand Down
5 changes: 3 additions & 2 deletions all_contributors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down Expand Up @@ -68,7 +68,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bardsleypt"><img src="https://avatars.githubusercontent.com/u/54084289?v=4?s=100" width="100px;" alt="bardsleypt"/><br /><sub><b>bardsleypt</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Abardsleypt" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=bardsleypt" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ndrewwang"><img src="https://avatars.githubusercontent.com/u/56122552?v=4?s=100" width="100px;" alt="ndrewwang"/><br /><sub><b>ndrewwang</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Andrewwang" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=ndrewwang" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MichaPhilipp"><img src="https://avatars.githubusercontent.com/u/58085966?v=4?s=100" width="100px;" alt="MichaPhilipp"/><br /><sub><b>MichaPhilipp</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3AMichaPhilipp" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/abillscmu"><img src="https://avatars.githubusercontent.com/u/48105066?v=4?s=100" width="100px;" alt="Alec Bills"/><br /><sub><b>Alec Bills</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=abillscmu" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aabills"><img src="https://avatars.githubusercontent.com/u/48105066?v=4?s=100" width="100px;" alt="Alec Bills"/><br /><sub><b>Alec Bills</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=aabills" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/agriyakhetarpal"><img src="https://avatars.githubusercontent.com/u/74401230?v=4?s=100" width="100px;" alt="Agriya Khetarpal"/><br /><sub><b>Agriya Khetarpal</b></sub></a><br /><a href="#infra-agriyakhetarpal" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=agriyakhetarpal" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=agriyakhetarpal" title="Documentation">📖</a> <a href="https://github.com/pybamm-team/PyBaMM/pulls?q=is%3Apr+reviewed-by%3Aagriyakhetarpal" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/awadell1"><img src="https://avatars.githubusercontent.com/u/5857298?v=4?s=100" width="100px;" alt="Alex Wadell"/><br /><sub><b>Alex Wadell</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Tests">⚠️</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=awadell1" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/iatzak"><img src="https://avatars.githubusercontent.com/u/112731474?v=4?s=100" width="100px;" alt="iatzak"/><br /><sub><b>iatzak</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=iatzak" title="Documentation">📖</a> <a href="https://github.com/pybamm-team/PyBaMM/issues?q=author%3Aiatzak" title="Bug reports">🐛</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=iatzak" title="Code">💻</a></td>
Expand Down Expand Up @@ -131,6 +131,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="http://marcberliner.com"><img src="https://avatars.githubusercontent.com/u/34451391?v=4?s=100" width="100px;" alt="Marc Berliner"/><br /><sub><b>Marc Berliner</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=MarcBerliner" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=MarcBerliner" title="Documentation">📖</a> <a href="#infra-MarcBerliner" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-MarcBerliner" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Aswinr24"><img src="https://avatars.githubusercontent.com/u/135364633?v=4?s=100" width="100px;" alt="Aswinr24"/><br /><sub><b>Aswinr24</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=Aswinr24" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/isaacbasil"><img src="https://avatars.githubusercontent.com/u/123981577?v=4?s=100" width="100px;" alt="isaacbasil"/><br /><sub><b>isaacbasil</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=isaacbasil" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AndEsterson"><img src="https://avatars.githubusercontent.com/u/55912083?v=4?s=100" width="100px;" alt="Andrew Esterson"/><br /><sub><b>Andrew Esterson</b></sub></a><br /><a href="#infra-AndEsterson" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions docs/source/api/solvers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Solvers
algebraic_solvers
solution
processed_variable
summary_variables
5 changes: 5 additions & 0 deletions docs/source/api/solvers/summary_variables.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Summary Variables
======================

.. autoclass:: pybamm.SummaryVariables
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@
"second = 0.1\n",
"parameter_values.update(\n",
" {\n",
" \"Primary: Negative electrode reference concentration for free of deformation [mol.m-3]\": 0.0,\n",
" \"Secondary: Negative electrode reference concentration for free of deformation [mol.m-3]\": 0.0,\n",
" \"Primary: Negative electrode LAM constant proportional term [s-1]\": 1e-4 / 3600,\n",
" \"Secondary: Negative electrode LAM constant proportional term [s-1]\": 1e-4\n",
" / 3600\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/notebooks/models/using-submodels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,10 @@
" model.param, \"positive\", model.options, cracks=True\n",
")\n",
"model.submodels[\"Negative lithium plating\"] = pybamm.lithium_plating.NoPlating(\n",
" model.param, \"Negative\"\n",
" model.param, \"negative\"\n",
")\n",
"model.submodels[\"Positive lithium plating\"] = pybamm.lithium_plating.NoPlating(\n",
" model.param, \"Positive\"\n",
" model.param, \"positive\"\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "right-skiing",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -638,7 +638,7 @@
}
],
"source": [
"sorted(sol.summary_variables.keys())"
"sorted(sol.summary_variables.all_variables)"
]
},
{
Expand Down Expand Up @@ -1936,7 +1936,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "venv",
"language": "python",
"name": "python3"
},
Expand All @@ -1950,7 +1950,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.10"
},
"toc": {
"base_numbering": 1,
Expand All @@ -1964,11 +1964,6 @@
"toc_position": {},
"toc_section_display": true,
"toc_window_display": true
},
"vscode": {
"interpreter": {
"hash": "612adcc456652826e82b485a1edaef831aa6d5abc680d008e93d513dd8724f14"
}
}
},
"nbformat": 4,
Expand Down
12 changes: 12 additions & 0 deletions docs/source/user_guide/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Package Minimum supp
`pandas <https://pypi.org/project/pandas/>`__ 1.5.0
`pooch <https://www.fatiando.org/pooch/>`__ 1.8.1
`posthog <https://posthog.com/>`__ 3.6.5
`pyyaml <https://pyyaml.org/>`__
`platformdirs <https://platformdirs.readthedocs.io/en/latest/>`__
=================================================================== ==========================

.. _install.optional_dependencies:
Expand Down Expand Up @@ -102,13 +104,21 @@ Installable with ``pip install "pybamm[docs]"``
Dependency Minimum Version pip extra Notes
================================================================================================= ================== ================== =======================================================================
`sphinx <https://www.sphinx-doc.org/en/master/>`__ \- docs Sphinx makes it easy to create intelligent and beautiful documentation.
`sphinx_rtd_theme <https://pypi.org/project/sphinx-rtd-theme/>`__ \- docs This Sphinx theme provides a great reader experience for documentation.
`pydata-sphinx-theme <https://pydata-sphinx-theme.readthedocs.io/en/stable/>`__ \- docs A clean, Bootstrap-based Sphinx theme.
`sphinx_design <https://sphinx-design.readthedocs.io/en/latest/>`__ \- docs A sphinx extension for designing.
`sphinx-copybutton <https://sphinx-copybutton.readthedocs.io/en/latest/>`__ \- docs To copy codeblocks.
`myst-parser <https://myst-parser.readthedocs.io/en/latest/>`__ \- docs For technical & scientific documentation.
`sphinx-inline-tabs <https://sphinx-inline-tabs.readthedocs.io/en/latest/>`__ \- docs Add inline tabbed content to your Sphinx documentation.
`sphinxcontrib-bibtex <https://sphinxcontrib-bibtex.readthedocs.io/en/latest/>`__ \- docs For BibTeX citations.
`sphinx-autobuild <https://sphinx-extensions.readthedocs.io/en/latest/sphinx-autobuild.html>`__ \- docs For re-building docs once triggered.
`sphinx-last-updated-by-git <https://pypi.org/project/sphinx-last-updated-by-git/>`__ \- docs To get the "last updated" time for each Sphinx page from Git.
`nbsphinx <https://nbsphinx.readthedocs.io/en/0.9.5/>`__ \- docs Sphinx extension that provides a source parser for .ipynb files
`ipykernel <https://pypi.org/project/ipykernel/>`__ \- docs Provides the IPython kernel for Jupyter.
`ipywidgets <https://ipywidgets.readthedocs.io/en/latest/>`__ \- docs Interactive HTML widgets for Jupyter notebooks and the IPython kernel.
`sphinx-gallery <https://pypi.org/project/sphinx-gallery/>`__ \- docs Builds an HTML gallery of examples from any set of Python scripts.
`sphinx-hoverxref <https://sphinx-hoverxref.readthedocs.io/en/latest/index.html>`__ \- docs Sphinx extension to show a floating window.
`sphinx-docsearch <https://sphinx-docsearch.readthedocs.io/>`__ \- docs To replaces Sphinx’s built-in search with Algolia DocSearch.
================================================================================================= ================== ================== =======================================================================

.. _install.examples_dependencies:
Expand Down Expand Up @@ -142,7 +152,9 @@ Dependency
`pytest <https://docs.pytest.org/en/stable/>`__ 6.0.0 dev For running the test suites.
`pytest-doctestplus <https://github.com/scientific-python/pytest-doctestplus>`__ \- dev For running doctests.
`pytest-xdist <https://pytest-xdist.readthedocs.io/en/latest/>`__ \- dev For running tests in parallel across distributed workers.
`pytest-mock <https://pytest-mock.readthedocs.io/en/latest/index.html>`__ \- dev Provides a mocker fixture.
`nbmake <https://github.com/treebeardtech/nbmake/>`__ \- dev A ``pytest`` plugin for executing Jupyter notebooks.
`importlib-metadata <https://pypi.org/project/importlib-metadata/>`__ \- dev Used to read metadata from Python packages.
================================================================================ ================== ================== =============================================================

.. _install.cite_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cite = [
]
# Battery Parameter eXchange format
bpx = [
"bpx>=0.4.0",
"bpx==0.4.0",
]
# Low-overhead progress bars
tqdm = [
Expand Down
1 change: 1 addition & 0 deletions src/pybamm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
from .solvers.processed_variable_time_integral import ProcessedVariableTimeIntegral
from .solvers.processed_variable import ProcessedVariable, process_variable
from .solvers.processed_variable_computed import ProcessedVariableComputed
from .solvers.summary_variable import SummaryVariables
from .solvers.base_solver import BaseSolver
from .solvers.dummy_solver import DummySolver
from .solvers.algebraic_solver import AlgebraicSolver
Expand Down
2 changes: 1 addition & 1 deletion src/pybamm/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def on_cycle_end(self, logs):

voltage_stop = logs["stopping conditions"]["voltage"]
if voltage_stop is not None:
min_voltage = logs["summary variables"]["Minimum voltage [V]"]
min_voltage = logs["Minimum voltage [V]"]
if min_voltage > voltage_stop[0]:
self.logger.notice(
f"Minimum voltage is now {min_voltage:.3f} V "
Expand Down
Loading

0 comments on commit 8da3481

Please sign in to comment.