Skip to content

Commit 6e5c007

Browse files
authored
Merge pull request #46 from pybop-team/develop
Initial release - v23.11
2 parents b8b76fb + dd88872 commit 6e5c007

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+7301
-134
lines changed

.all-contributorsrc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"files": [
3+
"README.md"
4+
],
5+
"imageSize": 100,
6+
"commit": false,
7+
"commitType": "docs",
8+
"commitConvention": "angular",
9+
"contributors": [
10+
{
11+
"login": "BradyPlanden",
12+
"name": "Brady Planden",
13+
"avatar_url": "https://avatars.githubusercontent.com/u/55357039?v=4",
14+
"profile": "http://bradyplanden.github.io",
15+
"contributions": [
16+
"infra",
17+
"test",
18+
"code",
19+
"example"
20+
]
21+
},
22+
{
23+
"login": "NicolaCourtier",
24+
"name": "NicolaCourtier",
25+
"avatar_url": "https://avatars.githubusercontent.com/u/45851982?v=4",
26+
"profile": "https://github.com/NicolaCourtier",
27+
"contributions": [
28+
"code",
29+
"review"
30+
]
31+
},
32+
{
33+
"login": "davidhowey",
34+
"name": "David Howey",
35+
"avatar_url": "https://avatars.githubusercontent.com/u/2247552?v=4",
36+
"profile": "http://howey.eng.ox.ac.uk",
37+
"contributions": [
38+
"ideas",
39+
"mentoring"
40+
]
41+
},
42+
{
43+
"login": "martinjrobins",
44+
"name": "Martin Robinson",
45+
"avatar_url": "https://avatars.githubusercontent.com/u/1148404?v=4",
46+
"profile": "http://www.rse.ox.ac.uk",
47+
"contributions": [
48+
"ideas",
49+
"mentoring"
50+
]
51+
}
52+
],
53+
"contributorsPerLine": 7,
54+
"skipCi": true,
55+
"repoType": "github",
56+
"repoHost": "https://github.com",
57+
"projectName": "PyBOP",
58+
"projectOwner": "pybop-team"
59+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Bug Report
2+
description: Create a bug report
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for filling out this report to help us improve!
10+
- type: input
11+
id: python-version
12+
attributes:
13+
label: Python Version
14+
description: What python version are you using?
15+
placeholder: python version
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: bug-description
20+
attributes:
21+
label: Describe the bug
22+
description: A clear and concise description of the bug.
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: reproduce
27+
attributes:
28+
label: Steps to reproduce the behaviour
29+
description: Tell us how to reproduce this behaviour. Please try to include a [Minimum Workable Example](https://stackoverflow.com/help/minimal-reproducible-example)
30+
validations:
31+
required: true
32+
- type: textarea
33+
id: logs
34+
attributes:
35+
label: Relevant log output
36+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
37+
render: shell
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Feature request
2+
description: Suggest a feature
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for filling out this report to help us improve!
9+
- type: textarea
10+
id: feature
11+
attributes:
12+
label: Feature description
13+
description: Describe the feature you'd like.
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: motivation
18+
attributes:
19+
label: Motivation
20+
description: Please enter the motivation for this feature i.e (problem, performance, etc).
21+
- type: textarea
22+
id: possible-implementation
23+
attributes:
24+
label: Possible implementation
25+
description: Please enter any possible implementation for this feature.
26+
- type: textarea
27+
id: context
28+
attributes:
29+
label: Additional context
30+
description: Add any additional context about the feature request.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.8"
16+
- name: Install pypa/build
17+
run: >-
18+
python3 -m
19+
pip install
20+
build
21+
--user
22+
- name: Build a binary wheel and a source tarball
23+
run: python3 -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v3
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-pypi:
31+
name: >-
32+
Publish Python 🐍 distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/pybop
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
42+
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution 📦 to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
52+
github-release:
53+
name: >-
54+
Sign the Python 🐍 distribution 📦 with Sigstore
55+
and upload them to GitHub Release
56+
needs:
57+
- publish-to-pypi
58+
runs-on: ubuntu-latest
59+
60+
permissions:
61+
contents: write # IMPORTANT: mandatory for making GitHub Releases
62+
id-token: write # IMPORTANT: mandatory for sigstore
63+
64+
steps:
65+
- name: Download all the dists
66+
uses: actions/download-artifact@v3
67+
with:
68+
name: python-package-distributions
69+
path: dist/
70+
- name: Sign the dists with Sigstore
71+
uses: sigstore/gh-action-sigstore-python@v1.2.3
72+
with:
73+
inputs: >-
74+
./dist/*.tar.gz
75+
./dist/*.whl
76+
- name: Upload artifact signatures to GitHub Release
77+
env:
78+
GITHUB_TOKEN: ${{ github.token }}
79+
# Upload to GitHub Release using the `gh` CLI.
80+
# `dist/` contains the built packages, and the
81+
# sigstore-produced signatures and certificates.
82+
run: >-
83+
gh release upload
84+
'${{ github.ref_name }}' dist/**
85+
--repo '${{ github.repository }}'
86+
87+
publish-to-testpypi:
88+
name: Publish Python 🐍 distribution 📦 to TestPyPI
89+
if: contains(github.ref, 'rc') # only publish to TestPyPI for rc tags
90+
needs:
91+
- build
92+
runs-on: ubuntu-latest
93+
94+
environment:
95+
name: testpypi
96+
url: https://test.pypi.org/project/pybop/
97+
98+
permissions:
99+
id-token: write # IMPORTANT: mandatory for trusted publishing
100+
101+
steps:
102+
- name: Download all the dists
103+
uses: actions/download-artifact@v3
104+
with:
105+
name: python-package-distributions
106+
path: dist/
107+
- name: Publish distribution 📦 to TestPyPI
108+
uses: pypa/gh-action-pypi-publish@release/v1
109+
with:
110+
repository-url: https://test.pypi.org/legacy/
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Scheduled
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
# runs every day at 09:00 UTC
10+
schedule:
11+
- cron: '0 9 * * *'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.8", "3.9", "3.10", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip nox
30+
- name: Unit tests with nox
31+
run: |
32+
python -m nox -s unit
33+
python -m nox -s notebooks
34+
35+
#M-series Mac Mini
36+
build-apple-mseries:
37+
runs-on: [self-hosted, macOS, ARM64]
38+
env:
39+
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
python-version: ["3.10"]
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Install python & create virtualenv
48+
shell: bash
49+
run: |
50+
eval "$(pyenv init -)"
51+
pyenv install ${{ matrix.python-version }} -s
52+
pyenv virtualenv ${{ matrix.python-version }} pybop-${{ matrix.python-version }}
53+
54+
- name: Install dependencies & run unit tests
55+
shell: bash
56+
run: |
57+
eval "$(pyenv init -)"
58+
pyenv activate pybop-${{ matrix.python-version }}
59+
python -m pip install --upgrade pip wheel setuptools nox
60+
python -m nox -s unit
61+
python -m nox -s notebooks
62+
63+
- name: Uninstall pyenv-virtualenv & python
64+
if: always()
65+
shell: bash
66+
run: |
67+
eval "$(pyenv init -)"
68+
pyenv activate pybop-${{ matrix.python-version }}
69+
pyenv uninstall -f $( python --version )
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: test_on_push
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
pull_request:
7+
8+
concurrency:
9+
# github.workflow: name of the workflow, so that we don't cancel other workflows
10+
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
# Cancel in-progress runs when a new workflow with the same group name is triggered
13+
# This avoids workflow runs on both pushes and PRs
14+
cancel-in-progress: true
15+
16+
jobs:
17+
style:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Setup Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.11
25+
26+
- name: Check formatting with pre-commit
27+
run: |
28+
python -m pip install pre-commit
29+
pre-commit run ruff
30+
31+
32+
build:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
python-version: ["3.8", "3.9", "3.10", "3.11"]
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip nox
48+
- name: Unit tests with nox
49+
run: |
50+
nox -s unit
51+
52+
# Runs only on Ubuntu with Python 3.11
53+
check_coverage:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
name: Coverage tests (ubuntu-latest / Python 3.11)
58+
59+
steps:
60+
- name: Check out PyBOP repository
61+
uses: actions/checkout@v4
62+
- name: Set up Python 3.11
63+
id: setup-python
64+
uses: actions/setup-python@v4
65+
with:
66+
python-version: 3.11
67+
cache: 'pip'
68+
cache-dependency-path: setup.py
69+
70+
- name: Install dependencies
71+
run: |
72+
python -m pip install --upgrade pip nox
73+
- name: Run coverage tests for Ubuntu with Python 3.11 and generate report
74+
run: nox -s coverage
75+
76+
- name: Upload coverage report
77+
uses: codecov/codecov-action@v3
78+
env:
79+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,6 @@ $RECYCLE.BIN/
301301
*.lnk
302302

303303
# End of https://www.toptal.com/developers/gitignore/api/python,macos,windows,linux,c
304+
305+
# Visual Studio Code settings
306+
.vscode/*

0 commit comments

Comments
 (0)