Skip to content

Commit

Permalink
Merge branch 'develop' into i2376-bpx
Browse files Browse the repository at this point in the history
  • Loading branch information
rtimms committed Nov 1, 2022
2 parents 47f8ad2 + a5aca9c commit 4f84c2a
Show file tree
Hide file tree
Showing 72 changed files with 1,685 additions and 2,076 deletions.
20 changes: 20 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,26 @@
"contributions": [
"code"
]
},
{
"login": "agriyakhetarpal",
"name": "Agriya Khetarpal",
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
"profile": "https://github.com/agriyakhetarpal",
"contributions": [
"infra"
]
},
{
"login": "awadell1",
"name": "Alex Wadell",
"avatar_url": "https://avatars.githubusercontent.com/u/5857298?v=4",
"profile": "https://github.com/awadell1",
"contributions": [
"code",
"test",
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/new_parameter_set.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: New Parameter Set
description: Add a third party parameter set to PyBaMM's documentation
body:
- type: markdown
attributes:
value: |
Third-party parameter sets can be added to PyBaMM by registering an entry
point with `pybamm-parameter-sets` as described in our
[documentation](https://pybamm.readthedocs.io/en/latest/source/parameters/parameter_sets.html).
- type: input
id: parameter-set-url
attributes:
label: Where can we find your parameter set?
description: Provide the Github URL or PyPi package name for your parameter set
placeholder: https://github.com/AwesomeOrg/NewParameterSet
validations:
required: true
- type: dropdown
id: open-source-approved
attributes:
label: Is your package open source?
description: See the [Open Source Initiative's List of Approved Licenses](https://opensource.org/licenses)
options: ["Yes", "No"]
- type: textarea
id: feedback
attributes:
label: Any additional information?
description: Thank you for making parameter set! Is there anything else we should know about it?
6 changes: 3 additions & 3 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9

- name: Check style
run: |
Expand All @@ -46,7 +46,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
if: matrix.os != 'windows-latest'
run: tox -e julia

- name: Run unit tests for GNU/Linux with Python 3.7 and 3.8
- name: Run unit tests for GNU/Linux with Python 3.8
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.9
run: python -m tox -e unit

Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/update_parameter_sets_doc.yml

This file was deleted.

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/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.2
rev: v3.0.0-alpha.3
hooks:
- id: prettier
exclude: assets/js/webapp\.js
Expand Down
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: pip
path: .
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

# [v22.10](https://github.com/pybamm-team/PyBaMM/tree/v22.10) - 2022-10-31

## Features

- Third-party parameter sets can be added by registering entry points to `pybamm_parameter_set` ([#2396](https://github.com/pybamm-team/PyBaMM/pull/2396))
- Added three-dimensional interpolation ([#2380](https://github.com/pybamm-team/PyBaMM/pull/2380))

## Bug fixes

- `pybamm.have_julia()` now checks that julia is properly configured ([#2402](https://github.com/pybamm-team/PyBaMM/pull/2402))
- For simulations with events that cause the simulation to stop early, the sensitivities could be evaluated incorrectly to zero ([#2337](https://github.com/pybamm-team/PyBaMM/pull/2337))

## Optimizations

- Reformatted how simulations with experiments are built ([#2395](https://github.com/pybamm-team/PyBaMM/pull/2395))
- Added small perturbation to initial conditions for casadi solver. This seems to help the solver converge better in some cases ([#2356](https://github.com/pybamm-team/PyBaMM/pull/2356))
- Added `ExplicitTimeIntegral` functionality to move variables which do not appear anywhere on the rhs to a new location, and to integrate those variables explicitly when `get` is called by the solution object. ([#2348](https://github.com/pybamm-team/PyBaMM/pull/2348))
- Added more rules for simplifying expressions ([#2211](https://github.com/pybamm-team/PyBaMM/pull/2211))
- Sped up calculations of Electrode SOH variables for summary variables ([#2210](https://github.com/pybamm-team/PyBaMM/pull/2210))

## Breaking change

- Removed `pybamm.SymbolReplacer` as it is no longer needed to set up simulations with experiments, which is the only place where it was being used ([#2395](https://github.com/pybamm-team/PyBaMM/pull/2395))
- Removed `get_infinite_nested_dict`, `BaseModel.check_default_variables_dictionaries`, and `Discretisation.create_jacobian` methods, which were not used by any other functionality in the repository ([#2384](https://github.com/pybamm-team/PyBaMM/pull/2384))
- Dropped support for Python 3.7 after the release of Numpy v1.22.0 ([#2379](https://github.com/pybamm-team/PyBaMM/pull/2379))
- Removed parameter cli tools (add/edit/remove parameters). Parameter sets can now more easily be added via python scripts. ([#2342](https://github.com/pybamm-team/PyBaMM/pull/2342))
- Parameter sets should now be provided as single python files containing all parameters and functions. Parameters provided as "data" (e.g. OCP vs SOC) can still be csv files, but must be either in the same folder as the parameter file or in a subfolder called "data/". See for example [Ai2020](https://github.com/pybamm-team/PyBaMM/tree/develop/pybamm/input/parameters/lithium_ion/Ai2020.py) ([#2342](https://github.com/pybamm-team/PyBaMM/pull/2342))

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: "22.9"
version: "22.10"
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 @@ -295,7 +295,7 @@ PyBaMM is documented in several ways.

First and foremost, every method and every class should have a [docstring](https://www.python.org/dev/peps/pep-0257/) that describes in plain terms what it does, and what the expected input and output is.

These docstrings can be fairly simple, but can also make use of [reStructuredText](http://docutils.sourceforge.net/docs/user/rst/quickref.html), a markup language designed specifically for writing [technical documentation](https://en.wikipedia.org/wiki/ReStructuredText). For example, you can link to other classes and methods by writing `` :class:`pybamm.Model` `` and `` :meth:`run()` ``.
These docstrings can be fairly simple, but can also make use of [reStructuredText](http://docutils.sourceforge.net/docs/user/rst/quickref.html), a markup language designed specifically for writing [technical documentation](https://en.wikipedia.org/wiki/ReStructuredText). For example, you can link to other classes and methods by writing ``:class:`pybamm.Model` `` and ``:meth:`run()` ``.

In addition, we write a (very) small bit of documentation in separate reStructuredText files in the `docs` directory. Most of what these files do is simply import docstrings from the source code. But they also do things like add tables and indexes. If you've added a new class to a module, search the `docs` directory for that module's `.rst` file and add your class (in alphabetical order) to its index. If you've added a whole new module, copy-paste another module's file and add a link to your new file in the appropriate `index.rst` file.

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-46-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-48-orange.svg)](#-contributors)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Expand Down Expand Up @@ -214,6 +214,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><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"><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"><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"><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></td>
<td align="center"><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>
</tr>
</tbody>
</table>
Expand Down
29 changes: 27 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
import os
import sys

import pybamm
import guzzle_sphinx_theme

sys.path.insert(0, os.path.abspath("../"))
Expand All @@ -27,7 +27,7 @@
author = "The PyBaMM Team"

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

Expand Down Expand Up @@ -213,3 +213,28 @@
# "scipy": ("http://docs.scipy.org/doc/scipy/reference", None),
"matplotlib": ("https://matplotlib.org", None),
}

# -- Jinja templating --------------------------------------------------------
# Credit to: https://ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/


def rstjinja(app, docname, source):
"""
Render our pages as a jinja template for fancy templating goodness.
"""
# Make sure we're outputting HTML
if app.builder.format != "html":
return
src = source[0]
rendered = app.builder.templates.render_string(src, app.config.html_context)
source[0] = rendered


def setup(app):
app.connect("source-read", rstjinja)


# Context for Jinja Templates
html_context = {
"parameter_sets": pybamm.parameter_sets,
}
3 changes: 1 addition & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ There are many ways to contribute to PyBaMM:
.. toctree::
:maxdepth: 1

tutorials/add-parameter-values
tutorials/add-model
tutorials/add-spatial-method
tutorials/add-solver

Before contributing, please read the `Contribution Guidelines <https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md>`_.
Before contributing, please read the `Contribution Guidelines <https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md>`_.
4 changes: 2 additions & 2 deletions docs/install/GNU-linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Prerequisites
=============

To use and/or contribute to PyBaMM, you must have Python 3.7, 3.8, or 3.9 installed.
To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed.

To install Python 3 on Debian-based distribution (Debian, Ubuntu, Linux
mint), open a terminal and run
Expand Down Expand Up @@ -46,7 +46,7 @@ User install

We recommend to install PyBaMM within a virtual environment, in order
not to alter any distribution python files.
First, make sure you are using python 3.7, 3.8, or 3.9.
First, make sure you are using python 3.8 or 3.9.
To create a virtual environment ``env`` within your current directory type:

.. code:: bash
Expand Down
4 changes: 2 additions & 2 deletions docs/install/install-from-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ or download the source archive on the repository's homepage.

To install PyBaMM, you will need:

- Python 3 (PyBaMM supports versions 3.7, 3.8, and 3.9)
- Python 3 (PyBaMM supports versions 3.8 and 3.9)
- The python headers file for your current python version.
- A BLAS library (for instance `openblas <https://www.openblas.net/>`_).
- A C compiler (ex: ``gcc``).
Expand Down Expand Up @@ -177,7 +177,7 @@ The default command
will run the full test suite (integration and unit tests).
This can take several minutes.

Is is often sufficient to run the unit tests only. To do so, use
It is often sufficient to run the unit tests only. To do so, use

.. code:: bash
Expand Down
4 changes: 2 additions & 2 deletions docs/install/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Windows
Prerequisites
-------------

To use and/or contribute to PyBaMM, you must have Python 3.7, 3.8, or 3.9 installed.
To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed.

To install Python 3 download the installation files from `Python’s
website <https://www.python.org/downloads/windows/>`__. Make sure to
tick the box on ``Add Python 3.X to PATH``. For more detailed
instructions please see the `official Python on Windows
guide <https://docs.python.org/3.7/using/windows.html>`__.
guide <https://docs.python.org/3.9/using/windows.html>`__.

Install PyBaMM
--------------
Expand Down
Loading

0 comments on commit 4f84c2a

Please sign in to comment.