Skip to content

Commit

Permalink
Merge pull request #46 from pybop-team/develop
Browse files Browse the repository at this point in the history
Initial release - v23.11
  • Loading branch information
BradyPlanden authored Nov 20, 2023
2 parents b8b76fb + dd88872 commit 6e5c007
Show file tree
Hide file tree
Showing 64 changed files with 7,301 additions and 134 deletions.
59 changes: 59 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "BradyPlanden",
"name": "Brady Planden",
"avatar_url": "https://avatars.githubusercontent.com/u/55357039?v=4",
"profile": "http://bradyplanden.github.io",
"contributions": [
"infra",
"test",
"code",
"example"
]
},
{
"login": "NicolaCourtier",
"name": "NicolaCourtier",
"avatar_url": "https://avatars.githubusercontent.com/u/45851982?v=4",
"profile": "https://github.com/NicolaCourtier",
"contributions": [
"code",
"review"
]
},
{
"login": "davidhowey",
"name": "David Howey",
"avatar_url": "https://avatars.githubusercontent.com/u/2247552?v=4",
"profile": "http://howey.eng.ox.ac.uk",
"contributions": [
"ideas",
"mentoring"
]
},
{
"login": "martinjrobins",
"name": "Martin Robinson",
"avatar_url": "https://avatars.githubusercontent.com/u/1148404?v=4",
"profile": "http://www.rse.ox.ac.uk",
"contributions": [
"ideas",
"mentoring"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "PyBOP",
"projectOwner": "pybop-team"
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug Report
description: Create a bug report
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for filling out this report to help us improve!
- type: input
id: python-version
attributes:
label: Python Version
description: What python version are you using?
placeholder: python version
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of the bug.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce the behaviour
description: Tell us how to reproduce this behaviour. Please try to include a [Minimum Workable Example](https://stackoverflow.com/help/minimal-reproducible-example)
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Feature request
description: Suggest a feature
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for filling out this report to help us improve!
- type: textarea
id: feature
attributes:
label: Feature description
description: Describe the feature you'd like.
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: Please enter the motivation for this feature i.e (problem, performance, etc).
- type: textarea
id: possible-implementation
attributes:
label: Possible implementation
description: Please enter any possible implementation for this feature.
- type: textarea
id: context
attributes:
label: Additional context
description: Add any additional context about the feature request.
110 changes: 110 additions & 0 deletions .github/workflows/release-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pybop
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: contains(github.ref, 'rc') # only publish to TestPyPI for rc tags
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/project/pybop/

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
69 changes: 69 additions & 0 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Scheduled

on:
workflow_dispatch:
pull_request:
branches:
- main

# runs every day at 09:00 UTC
schedule:
- cron: '0 9 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Unit tests with nox
run: |
python -m nox -s unit
python -m nox -s notebooks
#M-series Mac Mini
build-apple-mseries:
runs-on: [self-hosted, macOS, ARM64]
env:
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- name: Install python & create virtualenv
shell: bash
run: |
eval "$(pyenv init -)"
pyenv install ${{ matrix.python-version }} -s
pyenv virtualenv ${{ matrix.python-version }} pybop-${{ matrix.python-version }}
- name: Install dependencies & run unit tests
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python-version }}
python -m pip install --upgrade pip wheel setuptools nox
python -m nox -s unit
python -m nox -s notebooks
- name: Uninstall pyenv-virtualenv & python
if: always()
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python-version }}
pyenv uninstall -f $( python --version )
79 changes: 79 additions & 0 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: test_on_push

on:
push:
workflow_dispatch:
pull_request:

concurrency:
# github.workflow: name of the workflow, so that we don't cancel other workflows
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel in-progress runs when a new workflow with the same group name is triggered
# This avoids workflow runs on both pushes and PRs
cancel-in-progress: true

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Check formatting with pre-commit
run: |
python -m pip install pre-commit
pre-commit run ruff
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Unit tests with nox
run: |
nox -s unit
# Runs only on Ubuntu with Python 3.11
check_coverage:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Coverage tests (ubuntu-latest / Python 3.11)

steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: setup.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Run coverage tests for Ubuntu with Python 3.11 and generate report
run: nox -s coverage

- name: Upload coverage report
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,6 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/python,macos,windows,linux,c

# Visual Studio Code settings
.vscode/*
Loading

0 comments on commit 6e5c007

Please sign in to comment.