Skip to content

Commit

Permalink
Merge pull request #403 from pybop-team/399-add-lychee-ci
Browse files Browse the repository at this point in the history
Add Lychee link checking
  • Loading branch information
BradyPlanden authored Jul 10, 2024
2 parents 639e67a + c5ad86e commit d462f27
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 218 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

- [#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
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
283 changes: 90 additions & 193 deletions examples/notebooks/pouch_cell_identification.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/notebooks/spm_electrode_design.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"NOTE: This is a brittle example, the classes and methods below will be integrated into PyBOP in a future release.\n",
"\n",
"A design optimisation example loosely based on work by L.D. Couto available at https://doi.org/10.1016/j.energy.2022.125966.\n",
"A design optimisation example loosely based on work by L.D. Couto available at [[1]](https://doi.org/10.1016/j.energy.2022.125966).\n",
"\n",
"The target is to maximise the gravimetric energy density over a range of possible design parameter values, including for example:\n",
"\n",
Expand Down Expand Up @@ -396,7 +396,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.7"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Homepage = "https://github.com/pybop-team/PyBOP"
Documentation = "https://pybop-docs.readthedocs.io"
Repository = "https://github.com/pybop-team/PyBOP"
Releases = "https://github.com/pybop-team/PyBOP/releases"
Changelog = "https://github.com/pybop-team/PyBOP/CHANGELOG.md"
Changelog = "https://github.com/pybop-team/PyBOP/blob/develop/CHANGELOG.md"

[tool.pytest.ini_options]
addopts = "--showlocals -v -n auto"
Expand Down

0 comments on commit d462f27

Please sign in to comment.