Skip to content

Commit

Permalink
Merge pull request #491 from pybop-team/release-v24.9
Browse files Browse the repository at this point in the history
Release v24.9.0
  • Loading branch information
BradyPlanden authored Sep 11, 2024
2 parents eefd9e7 + 061fef9 commit 99632b9
Show file tree
Hide file tree
Showing 131 changed files with 15,444 additions and 11,605 deletions.
23 changes: 21 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"profile": "https://www.brosaplanella.xyz",
"contributions": [
"review",
"code"
"code",
"example"
]
},
{
Expand Down Expand Up @@ -97,7 +98,7 @@
{
"login": "IntelLiGent",
"name": "Horizon Europe IntelLiGent Consortium",
"avatar_url": "assets/logo-farger.pdf",
"avatar_url": "assets/logo-farger.svg",
"profile": "https://heuintelligent.eu/",
"contributions": [
"financial"
Expand All @@ -111,6 +112,24 @@
"contributions": [
"code"
]
},
{
"login": "MarkBlyth",
"name": "MarkBlyth",
"avatar_url": "https://avatars.githubusercontent.com/u/20501619?v=4",
"profile": "https://github.com/MarkBlyth",
"contributions": [
"code"
]
},
{
"login": "f-g-r-i-m-m",
"name": "f-g-r-i-m-m",
"avatar_url": "https://avatars.githubusercontent.com/u/137511310?v=4",
"profile": "https://github.com/f-g-r-i-m-m",
"contributions": [
"example"
]
}
],
"contributorsPerLine": 7,
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/lychee_links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Lychee Link Checking

name: Links
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 6 * * 0' # Run weekly on Sundays at 06:00 UTC

jobs:
Lychee:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Set up Lychee
uses: lycheeverse/[email protected]
with:
args: >-
--cache
--no-progress
--max-cache-age 2d
--timeout 10
--max-retries 5
--skip-missing
--exclude-loopback
--accept 200,429
--exclude "https://tiles.stadiamaps.com/*|https://b.tile.openstreetmap.org/*"
--exclude "https://cartodb-basemaps-c.global.ssl.fastly.net/*"
--exclude "https://events.mapbox.com/*|https://events.mapbox.cn/*|https://api.mapbox.cn/*"
--exclude "https://github.com/mikolalysenko/glsl-read-float/*"
--exclude "https://fonts.openmaptiles.org/*"
--exclude "https://a.tile.openstreetmap.org/*"
--exclude "https://openstreetmap.org/*|https://www.openstreetmap.org/*"
--exclude "https://cdn.plot.ly/*"
--exclude "http://www.w3.org/*|https://www.w3.org/*"
--exclude "https://doi.org/*"
--exclude "https://raw.githubusercontent.com/paramm-team/pybamm-param/develop/pbparam/input/data/"
--exclude-path ./CHANGELOG.md
--exclude-path asv.conf.json
--exclude-path docs/conf.py
'./**/*.rst'
'./**/*.md'
'./**/*.py'
'./**/*.ipynb'
'./**/*.json'
'./**/*.toml'
fail: true
jobSummary: true
format: markdown
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,37 @@ jobs:
run: |
nox -s examples
# Quick benchmarks on macos-14
benchmarks:
needs: style
runs-on: macos-14
strategy:
fail-fast: false
name: Benchmarks

steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python 3.12
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip asv[virtualenv]
- name: Run quick benchmarks
shell: bash
run: |
asv machine --machine "GitHubRunner"
asv run --machine "GitHubRunner" --quick --show-stderr
# Runs only on macos-14 with Python 3.12
check_coverage:
needs: style
Expand Down
8 changes: 7 additions & 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.5.0"
rev: "v0.6.4"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down Expand Up @@ -32,3 +32,9 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args: ['--keep-output', '--drop-empty-cells']
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,52 @@

## Breaking Changes

# [v24.9.0](https://github.com/pybop-team/PyBOP/tree/v24.9.0) - 2024-09-10

## Features

- [#462](https://github.com/pybop-team/PyBOP/pull/462) - Enables multidimensional learning rate for `pybop.AdamW` with updated (more robust) integration testing. Fixes bug in `Minkowski` and `SumofPower` cost functions for gradient-based optimisers.
- [#411](https://github.com/pybop-team/PyBOP/pull/411) - Updates notebooks with README in `examples/` directory, removes kaleido dependency and moves to nbviewer rendering, displays notebook figures with `notebook_connected` plotly renderer
- [#6](https://github.com/pybop-team/PyBOP/issues/6) - Adds Monte Carlo functionality, with methods based on Pints' algorithms. A base class is added `BaseSampler`, in addition to `PintsBaseSampler`.
- [#353](https://github.com/pybop-team/PyBOP/issues/353) - Allow user-defined check_params functions to enforce nonlinear constraints, and enable SciPy constrained optimisation methods
- [#222](https://github.com/pybop-team/PyBOP/issues/222) - Adds an example for performing and electrode balancing.
- [#441](https://github.com/pybop-team/PyBOP/issues/441) - Adds an example for estimating constants within a `pybamm.FunctionalParameter`.
- [#405](https://github.com/pybop-team/PyBOP/pull/405) - Adds frequency-domain based EIS prediction methods via `model.simulateEIS` and updates to `problem.evaluate` with examples and tests.
- [#460](https://github.com/pybop-team/PyBOP/pull/460) - Notebook example files added for ECM and folder structure updated.
- [#450](https://github.com/pybop-team/PyBOP/pull/450) - Adds support for IDAKLU with output variables, and corresponding examples, tests.
- [#364](https://github.com/pybop-team/PyBOP/pull/364) - Adds the MultiFittingProblem class and the multi_fitting example script.
- [#444](https://github.com/pybop-team/PyBOP/issues/444) - Merge `BaseModel` `build()` and `rebuild()` functionality.
- [#435](https://github.com/pybop-team/PyBOP/pull/435) - Adds SLF001 linting for private members.
- [#418](https://github.com/pybop-team/PyBOP/issues/418) - Wraps the `get_parameter_info` method from PyBaMM to get a dictionary of parameter names and types.
- [#413](https://github.com/pybop-team/PyBOP/pull/413) - Adds `DesignCost` functionality to `WeightedCost` class with additional tests.
- [#357](https://github.com/pybop-team/PyBOP/pull/357) - Adds `Transformation()` class with `LogTransformation()`, `IdentityTransformation()`, and `ScaledTransformation()`, `ComposedTransformation()` implementations with corresponding examples and tests.
- [#427](https://github.com/pybop-team/PyBOP/issues/427) - Adds the nbstripout pre-commit hook to remove unnecessary metadata from notebooks.
- [#327](https://github.com/pybop-team/PyBOP/issues/327) - Adds the `WeightedCost` subclass, defines when to evaluate a problem and adds the `spm_weighted_cost` example script.
- [#393](https://github.com/pybop-team/PyBOP/pull/383) - Adds Minkowski and SumofPower cost classes, with an example and corresponding tests.
- [#403](https://github.com/pybop-team/PyBOP/pull/403/) - Adds lychee link checking action.

## Bug Fixes

- [#473](https://github.com/pybop-team/PyBOP/pull/473) - Bugfixes for transformation class, adds optional `apply_transform` arg to `BaseCost.__call__()`, adds `log_update()` method to `BaseOptimiser`
- [#464](https://github.com/pybop-team/PyBOP/issues/464) - Fix order of design `parameter_set` updates and refactor `update_capacity`.
- [#468](https://github.com/pybop-team/PyBOP/issue/468) - Renames `quick_plot.py` to `standard_plots.py`.
- [#454](https://github.com/pybop-team/PyBOP/issue/454) - Fixes benchmarking suite.
- [#421](https://github.com/pybop-team/PyBOP/issues/421) - Adds a default value for the initial SOC for design problems.

## Breaking Changes

- [#483](https://github.com/pybop-team/PyBOP/pull/483) - Replaces `pybop.MAP` with `pybop.LogPosterior` with an updated call args and bugfixes.
- [#436](https://github.com/pybop-team/PyBOP/pull/436) - **API Change:** The functionality from `BaseCost.evaluate/S1` & `BaseCost._evaluate/S1` is represented in `BaseCost.__call__` & `BaseCost.compute`. `BaseCost.compute` directly acts on the predictions, while `BaseCost.__call__` calls `BaseProblem.evaluate/S1` before `BaseCost.compute`. `compute` has optional args for gradient cost calculations.
- [#424](https://github.com/pybop-team/PyBOP/issues/424) - Replaces the `init_soc` input to `FittingProblem` with the option to pass an initial OCV value, updates `BaseModel` and fixes `multi_model_identification.ipynb` and `spm_electrode_design.ipynb`.

# [v24.6.1](https://github.com/pybop-team/PyBOP/tree/v24.6.1) - 2024-07-31

## Features

- [#313](https://github.com/pybop-team/PyBOP/pull/313/) - Fixes for PyBaMM v24.5, drops support for PyBaMM v23.9, v24.1

## Bug Fixes


## Breaking Changes

# [v24.6](https://github.com/pybop-team/PyBOP/tree/v24.6) - 2024-07-08
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ authors:
family-names: Courtier
- given-names: David
family-names: Howey
version: "24.6.1" # Update this when you release a new version
version: "24.9.0" # Update this when you release a new version
repository-code: 'https://www.github.com/pybop-team/pybop'
18 changes: 11 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pip install -e .[all,dev]

Before you commit any code, please perform the following checks using [Nox](https://nox.thea.codes/en/stable/index.html):

- [All tests pass](#testing): `$ nox -s unit`
- [All tests pass](#testing): `$ nox -s quick`

### Installing and using pre-commit

Expand Down Expand Up @@ -62,9 +62,9 @@ You now have everything you need to start making changes!

### B. Writing your code

6. PyBOP is developed in [Python](https://en.wikipedia.org/wiki/Python_(programming_language)), and makes heavy use of [NumPy](https://en.wikipedia.org/wiki/NumPy) (see also [NumPy for MatLab users](https://numpy.org/doc/stable/user/numpy-for-matlab-users.html) and [Python for R users](http://blog.hackerearth.com/how-can-r-users-learn-python-for-data-science)).
6. PyBOP is developed in [Python](https://en.wikipedia.org/wiki/Python_(programming_language)), and makes heavy use of [NumPy](https://en.wikipedia.org/wiki/NumPy) (see also [NumPy for MatLab users](https://numpy.org/doc/stable/user/numpy-for-matlab-users.html) and [Python for R users](https://rebeccabarter.com/blog/2023-09-11-from_r_to_python)).
7. Make sure to follow our [coding style guidelines](#coding-style-guidelines).
8. Commit your changes to your branch with [useful, descriptive commit messages](https://chris.beams.io/posts/git-commit/): Remember these are publicly visible and should still make sense a few months ahead in time. While developing, you can keep using the GitHub issue you're working on as a place for discussion. [Refer to your commits](https://stackoverflow.com/questions/8910271/how-can-i-reference-a-commit-in-an-issue-comment-on-github) when discussing specific lines of code.
8. Commit your changes to your branch with [useful, descriptive commit messages](https://chris.beams.io/posts/git-commit/): Remember these are publicly visible and should still make sense a few months ahead in time. While developing, you can keep using the GitHub issue you're working on as a place for discussion. Refer to your commits when discussing specific lines of code. This is achieved by referencing the SHA-hash in the comment. An example of this looks like: `the commit 3e5c1e6 solved the issue...`
9. If you want to add a dependency on another library, or re-use code you found somewhere else, have a look at [these guidelines](#dependencies-and-reusing-code).

### C. Merging your changes with PyBOP
Expand All @@ -83,16 +83,20 @@ PyBOP follows the [PEP8 recommendations](https://www.python.org/dev/peps/pep-000

### Ruff

We use [ruff](https://github.com/charliermarsh/ruff) to check our PEP8 adherence. To try this on your system, navigate to the PyBOP directory in a console and type
We use [ruff](https://github.com/charliermarsh/ruff) to lint and ensure adherence to Python PEP standards. To manually trigger `ruff`, navigate to the PyBOP directory in a console and type

```bash
python -m pip install pre-commit
pre-commit run ruff
```

ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think this should be added or removed, please submit an [issue](https://guides.github.com/features/issues/).
ruff is configured inside the file `pyproject.toml`, allowing us to ignore some errors. If you think a rule should be added or removed, please submit an [issue](https://guides.github.com/features/issues/).

When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)).
When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)). If you are having issues getting your commit to pass the linting, it
is possible to skip linting for single lines (this should only be done as a **last resort**) by adding a line comment of `#noqa: $ruff_rule` where the `$ruff_rule` is replaced with the rule in question.
It is also possible to skip linting altogether by committing your changes by using the
`--no-verify` command-line flag.
These rules can be found in the ruff configuration in `pyproject.toml` or in the failed pre-commit output. Please note the lint skipping in the pull request for reviewers.

### Naming

Expand All @@ -105,7 +109,7 @@ Class names are CamelCase, and start with an upper case letter, for example `MyO
While it's a bad idea for developers to "reinvent the wheel", it's important for users to get a _reasonably sized download and an easy install_. In addition, external libraries can sometimes cease to be supported, and when they contain bugs it might take a while before fixes become available as automatic downloads to PyBOP users.
For these reasons, all dependencies in PyBOP should be thought about carefully and discussed on GitHub.

Direct inclusion of code from other packages is possible, as long as their license permits it and is compatible with ours, but again should be considered carefully and discussed in the group. Snippets from blogs and [stackoverflow](https://stackoverflow.com/) can often be included but must include attribution to the original by commenting with a link in the source code.
Direct inclusion of code from other packages is possible, as long as their license permits it and is compatible with ours, but again should be considered carefully and discussed in the group. Snippets from blogs and stackoverflow can often be included but must include attribution to the original by commenting with a link in the source code.

### Separating dependencies

Expand Down
Loading

0 comments on commit 99632b9

Please sign in to comment.