-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f911099
commit fd5987d
Showing
11 changed files
with
155 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build for (${{ matrix.python-version }}, ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
python-version: ['3.8'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Python info | ||
shell: bash -l {0} | ||
run: | | ||
which python3 | ||
python3 --version | ||
- name: Upgrade pip and install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip setuptools | ||
python3 -m pip install .[dev,publishing] | ||
- name: Run unit tests | ||
run: pytest -v | ||
- name: Verify that we can build the package | ||
run: python3 setup.py sdist bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Code coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox coveragepy-lcov 'coverage<7' | ||
- name: Run coverage | ||
run: tox -ecoverage | ||
- name: Convert to lcov | ||
run: coveragepy-lcov --output_file_path coveralls.info | ||
- name: Upload report to Coveralls | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
file: coveralls.info | ||
format: lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import numpy as np | ||
from hhl_prototype import HHL | ||
|
||
A = np.random.rand(4,4) | ||
A = A+A.T | ||
A = np.random.rand(4, 4) | ||
A = A + A.T | ||
|
||
b = np.random.rand(4) | ||
|
||
hhl = HHL() | ||
hhl.solve(A, b) | ||
hhl.solve(A, b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,3 @@ | |
MatrixFunctional | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[tox] | ||
minversion = 2.1 | ||
envlist = py38, py39, py310, lint, coverage | ||
# CI: skip-next-line | ||
skip_missing_interpreters = true | ||
|
||
[testenv] | ||
# CI: skip-next-line | ||
usedevelop = true | ||
install_command = pip install -U {opts} {packages} | ||
setenv = | ||
VIRTUAL_ENV={envdir} | ||
LANGUAGE=en_US | ||
LC_ALL=en_US.utf-8 | ||
extras = dev | ||
commands = | ||
pip check | ||
python -m pytest -v --doctest-modules | ||
treon docs --threads 2 | ||
|
||
[testenv:black] | ||
envdir = .tox/lint | ||
skip_install = true | ||
commands = black . | ||
|
||
[testenv:coverage] | ||
basepython = python3 | ||
setenv = | ||
{[testenv]setenv} | ||
commands = | ||
coverage3 run --source hhl_prototype --parallel-mode -m pytest --doctest-modules | ||
coverage3 combine | ||
coverage3 report | ||
|
||
|