Skip to content

Commit

Permalink
#2382 merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Nov 20, 2022
2 parents 4ec21f3 + 8478e9a commit 43afef6
Show file tree
Hide file tree
Showing 195 changed files with 2,551 additions and 6,348 deletions.
11 changes: 11 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,17 @@
"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?
10 changes: 0 additions & 10 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Julia
if: matrix.os != 'windows-latest'
uses: julia-actions/setup-julia@v1
with:
version: 1.7

- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down Expand Up @@ -92,10 +86,6 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: tox -e pybamm-requires

- name: Install Julia
if: matrix.os != 'windows-latest'
run: tox -e julia

- 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.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ test.json
# tox
.tox/

# julia
Manifest.toml

# vcpkg
vcpkg_installed/

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/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.2
rev: v3.0.0-alpha.4
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: .
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

## Features

- Added `scale` and `reference` attributes to `Variable` objects, which can be use to make the ODE/DAE solver better conditioned ([#2440](https://github.com/pybamm-team/PyBaMM/pull/2440))
- SEI reactions can now be asymmetric ([#2425](https://github.com/pybamm-team/PyBaMM/pull/2425))

## Optimizations

- Added more rules for simplifying expressions, especially around Concatenations. Also, meshes constructed from multiple domains are now cached ([#2443](https://github.com/pybamm-team/PyBaMM/pull/2443))
- Added more rules for simplifying expressions. Constants in binary operators are now moved to the left by default (e.g. `x*2` returns `2*x`) ([#2424](https://github.com/pybamm-team/PyBaMM/pull/2424))

## Breaking changes

- Renamed entry point for parameter sets to `pybamm_parameter_sets` ([#2475](https://github.com/pybamm-team/PyBaMM/pull/2475))
- Removed code for generating `ModelingToolkit` problems ([#2432](https://github.com/pybamm-team/PyBaMM/pull/2432))
- Removed `FirstOrder` and `Composite` lead-acid models, and some submodels specific to those models ([#2431](https://github.com/pybamm-team/PyBaMM/pull/2431))

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

## Breaking changes

- Removed all julia generation code ([#2453](https://github.com/pybamm-team/PyBaMM/pull/2453)). Julia code will be hosted at [PyBaMM.jl](https://github.com/tinosulzer/PyBaMM.jl) from now on.

# [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`~~`pybamm_parameter_sets` ([#2396](https://github.com/pybamm-team/PyBaMM/pull/2396), changed in [#2475](https://github.com/pybamm-team/PyBaMM/pull/2475))
- 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))
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
7 changes: 5 additions & 2 deletions 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-47-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-48-orange.svg)](#-contributors)

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

Expand Down Expand Up @@ -68,7 +68,9 @@ Additional supporting material can be found

Note that the examples on the default `develop` branch are tested on the latest `develop` commit. This may sometimes cause errors when running the examples on the pybamm pip package, which is synced to the `main` branch. You can switch to the `main` branch on github to see the version of the examples that is compatible with the latest pip release.

<!-- For further examples, see the list of repositories that use PyBaMM [here](https://github.com/pybamm-team/pybamm-example-results). -->
## Versioning

PyBaMM uses [CalVer](https://calver.org/), which means that we make new releases every month with the version number `YY.MM`. There is no difference between releases that increment the year and releases that increment the month; in particular, releases that increment the month may introduce breaking changes. Breaking changes for each release are communicated via the [CHANGELOG](CHANGELOG.md), and come with deprecation warnings or errors that are kept for at least one year (12 releases). If you find a breaking change that is not documented, or think it should be undone, please open an issue on [GitHub](https://github.com/pybamm-team/pybamm).

## 🚀 Installing PyBaMM

Expand Down Expand Up @@ -215,6 +217,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<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
4 changes: 4 additions & 0 deletions benchmarks/different_model_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ class TimeBuildModelSEI:
"none",
"constant",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
)

Expand All @@ -143,10 +145,12 @@ class TimeSolveSEI:
"none",
"constant",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
)

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>`_.
14 changes: 0 additions & 14 deletions docs/source/models/lead_acid/higher_order.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/models/lead_acid/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Lead Acid Models

base_lead_acid_model
loqs
higher_order
full

This file was deleted.

2 changes: 0 additions & 2 deletions docs/source/models/submodels/current_collector/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Current Collector
:maxdepth: 1

base_current_collector
composite_potential_pair
effective_resistance_current_collector
homogeneous_current_collector
potential_pair
quite_conductive_potential_pair

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Electrolyte Diffusion
base_electrolyte_diffusion
constant_concentration
leading_order_diffusion
composite_diffusion
full_diffusion

This file was deleted.

Loading

0 comments on commit 43afef6

Please sign in to comment.