Skip to content

Commit

Permalink
Merge branch 'develop' into 327-weighted-cost
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaCourtier authored Jul 11, 2024
2 parents eb5ce52 + 4638a60 commit 626a070
Show file tree
Hide file tree
Showing 46 changed files with 357 additions and 372 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/lychee_links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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://cdn.plot.ly/*"
--exclude "https://doi.org/*"
--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
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.5.0"
rev: "v0.5.1"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Features

- [#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.
- [#403](https://github.com/pybop-team/PyBOP/pull/403/) - Adds lychee link checking action.

## Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ 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.
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).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![Contributors](https://img.shields.io/github/contributors/pybop-team/PyBOP)](https://github.com/pybop-team/PyBOP/graphs/contributors)
[![Last Commit](https://img.shields.io/github/last-commit/pybop-team/PyBOP/develop?color=purple)](https://github.com/pybop-team/PyBOP/commits/develop)
[![Python Versions from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fpybop-team%2FPyBOP%2Fdevelop%2Fpyproject.toml&label=Python)](https://pypi.org/project/pybop/)
[![Forks](https://img.shields.io/github/forks/pybop-team/PyBOP?style=flat)](https://github.com/pybop-team/PyBOPe/network/members)
[![Forks](https://img.shields.io/github/forks/pybop-team/PyBOP?style=flat)](https://github.com/pybop-team/PyBOP/network/members)
[![Stars](https://img.shields.io/github/stars/pybop-team/PyBOP?style=flat&color=gold)](https://github.com/pybop-team/PyBOP/stargazers)
[![Codecov](https://codecov.io/gh/pybop-team/PyBOP/branch/develop/graph/badge.svg)](https://codecov.io/gh/pybop-team/PyBOP)
[![Open Issues](https://img.shields.io/github/issues/pybop-team/PyBOP)](https://github.com/pybop-team/PyBOP/issues/)
Expand Down Expand Up @@ -74,7 +74,7 @@ Additional script-based examples can be found in the [examples directory](https:
- [Unscented Kalman filter parameter identification of a SPM](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/spm_UKF.py)
- [Import and export parameters using Faraday's BPX format](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/BPX_spm.py)
- [Maximum a posteriori parameter identification of a SPM](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/BPX_spm.py)
- [Gradient based parameter identification of a SPM](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/spm_adam.py)
- [Gradient based parameter identification of a SPM](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/spm_AdamW.py)

### Supported Methods
The table below lists the currently supported [models](https://github.com/pybop-team/PyBOP/tree/develop/pybop/models), [optimisers](https://github.com/pybop-team/PyBOP/tree/develop/pybop/optimisers), and [cost functions](https://github.com/pybop-team/PyBOP/tree/develop/pybop/costs) in PyBOP.
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np

import pybop

from .benchmark_utils import set_random_seed
from benchmarks.benchmark_utils import set_random_seed


class BenchmarkModel:
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_optim_construction.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np

import pybop

from .benchmark_utils import set_random_seed
from benchmarks.benchmark_utils import set_random_seed


class BenchmarkOptimisationConstruction:
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_parameterisation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np

import pybop

from .benchmark_utils import set_random_seed
from benchmarks.benchmark_utils import set_random_seed


class BenchmarkParameterisation:
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_track_parameterisation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np

import pybop

from .benchmark_utils import set_random_seed
from benchmarks.benchmark_utils import set_random_seed


class BenchmarkTrackParameterisation:
Expand Down
6 changes: 3 additions & 3 deletions docs/_extension/gallery_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from pathlib import Path
from typing import Any, Dict, List
from typing import Any

from docutils import nodes
from docutils.parsers.rst import directives
Expand Down Expand Up @@ -68,7 +68,7 @@ class GalleryGridDirective(SphinxDirective):
"class-card": directives.unchanged,
}

def run(self) -> List[nodes.Node]:
def run(self) -> list[nodes.Node]:
"""Create the gallery grid."""
if self.arguments:
# If an argument is given, assume it's a path to a YAML file
Expand Down Expand Up @@ -129,7 +129,7 @@ def run(self) -> List[nodes.Node]:
return [container.children[0]]


def setup(app: Sphinx) -> Dict[str, Any]:
def setup(app: Sphinx) -> dict[str, Any]:
"""Add custom configuration to sphinx app.
Args:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from pathlib import Path

sys.path.append(str(Path(".").resolve()))
from pybop._version import __version__ # noqa: E402
from pybop._version import __version__

# -- Project information -----------------------------------------------------
project = "PyBOP"
copyright = "2023, The PyBOP Team"
copyright = "2023, The PyBOP Team" # noqa A001
author = "The PyBOP Team"
release = f"v{__version__}"

Expand Down
38 changes: 19 additions & 19 deletions examples/notebooks/LG_M50_ECM/1-single-pulse-circuit-model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"## LG M50 Single Pulse Parameter Identification\n",
"\n",
"This example presents an experimental parameter identification method for a two-RC circuit model. The data for this notebook is located within the same directory and was obtained from [[1]](https://github.com/WDWidanage/Simscape-Battery-Library/tree/main/Examples/parameterEstimation_TECMD/Data).\n",
"This example presents an experimental parameter identification method for a two-RC circuit model. The data for this notebook is located within the same directory and was obtained from WDWidanage/Simscape-Battery-Library [[1]](https://github.com/WDWidanage/Simscape-Battery-Library/tree/a3842b91b3ccda006bc9be5d59c8bcbd167ceef7/Examples/parameterEstimation_TECMD/Data).\n",
"\n",
"\n",
"### Setting up the Environment\n",
Expand Down Expand Up @@ -261,7 +261,7 @@
{
"type": "scatter",
"x": [
0.0,
0,
0.01800000004004687,
0.12100000004284084,
0.25100000004749745,
Expand Down Expand Up @@ -571,7 +571,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -607,7 +607,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand All @@ -631,7 +631,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -667,7 +667,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand All @@ -682,7 +682,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -718,7 +718,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand All @@ -745,7 +745,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -781,7 +781,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand All @@ -796,7 +796,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -832,7 +832,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand Down Expand Up @@ -977,7 +977,7 @@
},
"colorscale": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -1013,7 +1013,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
Expand Down Expand Up @@ -1104,7 +1104,7 @@
],
"sequential": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -1140,13 +1140,13 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
],
"sequentialminus": [
[
0.0,
0,
"#0d0887"
],
[
Expand Down Expand Up @@ -1182,7 +1182,7 @@
"#fdca26"
],
[
1.0,
1,
"#f0f921"
]
]
Expand Down Expand Up @@ -1888,7 +1888,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 626a070

Please sign in to comment.