Skip to content

Commit

Permalink
Merge pull request #13 from QSAR-UBC/add-ci-workflows
Browse files Browse the repository at this point in the history
Add basic CI workflows
  • Loading branch information
glassnotes authored May 8, 2024
2 parents 9578312 + 7d94c9c commit 430eb77
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "update-tests" ]

jobs:
build:

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

steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
- name: Format with black
run: |
black -l 100 ionizer/*.py tests/*.py
- name: Add & Commit
uses: EndBug/add-and-commit@v9.1.4
with:
add: "ionizer/*.py tests/*.py"
message: "Auto-format with black"
- name: Test with pytest
run: |
pytest tests/test_*.py
1 change: 1 addition & 0 deletions ionizer/identity_hunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Submodule to generate and store a database of circuit identities involving
up to 3 GPI/GPI2 gates.
"""

from importlib.resources import files

from itertools import product
Expand Down
2 changes: 2 additions & 0 deletions ionizer/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class GPI(Operation):
immediately pushed into the Operator queue (optional)
id (str or None): String representing the operation (optional)
"""

num_wires = 1
num_params = 1
ndim_params = (0,)
Expand Down Expand Up @@ -138,6 +139,7 @@ class MS(Operation):
immediately pushed into the Operator queue (optional)
id (str or None): String representing the operation (optional)
"""

num_wires = 2
num_params = 0

Expand Down

0 comments on commit 430eb77

Please sign in to comment.