Skip to content

Commit dcdb2be

Browse files
authored
Merge pull request #131 from q-optimize/release/1.3
Release/1.3
2 parents 2b41aac + 0626a23 commit dcdb2be

File tree

134 files changed

+15628
-5442
lines changed

Some content is hidden

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

134 files changed

+15628
-5442
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,22 @@ assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
## Describe the bug
1111
A clear and concise description of what the bug is.
1212

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
13+
## To Reproduce
14+
Steps to reproduce the behavior. This can be in the form of a code snippet or some config files or a notebook to produce a minimum viable example of the bug.
1915

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
16+
## Expected behavior
17+
A clear and concise description of what you expect(ed) to happen.
2218

23-
**Screenshots**
19+
## Screenshots
2420
If applicable, add screenshots to help explain your problem.
2521

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
22+
## Environment (please complete the following information)
23+
- OS: [e.g. MacOS]
24+
- Python Version: [e.g. 3.8]
25+
- `c3-toolset` Version [e.g. 1.2]
3026

31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
36-
37-
**Additional context**
38-
Add any other context about the problem here.
27+
## Additional context
28+
Add any other context about the problem here. You can also suggest possible solutions and relevant implementations & edge case details.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
## Describe the missing feature
11+
A clear and concise description of what the problem is and what is being missed. Ex. I'm always frustrated when [...]
1212

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
13+
## Describe the solution you'd like
14+
A clear and concise description of what you want to happen. If possible, provide example input-output descriptions or usecases. Better still, consider providing code snippets that outline the expected behaviour. Ex. I would like to call [...] on the [...] class objects to get [...] done.
1515

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
16+
## Describe alternatives you've considered
17+
How have you tried to resolve it in the current version of the code? Have you considered non `c3-toolset` alternative solutions? Please elaborate.
1818

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
19+
## Additional context
20+
Add any other context or screenshots about the feature request here. Please feel free to suggest details about how you believe this feature request might be best implemented. If you have used similar features in other libraries, consider providing links or resources to example implementations.

.github/prepare-nightly.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
import os
33
import re
44

5-
_PATH_INIT = os.path.join(os.getcwd(), 'c3', '__init__.py')
6-
_PATH_SETUP = os.path.join(os.getcwd(), 'setup.py')
5+
_PATH_INIT = os.path.join(os.getcwd(), "c3", "__init__.py")
6+
_PATH_SETUP = os.path.join(os.getcwd(), "setup.py")
77

88
# get today date
99
now = datetime.datetime.now()
1010
now_date = now.strftime("%Y%m%d")
1111

1212
print(f"Update init - replace version by {now_date}")
13-
with open(_PATH_INIT, 'r') as fp:
13+
with open(_PATH_INIT, "r") as fp:
1414
init = fp.read()
1515
init = re.sub(r'__version__ = [\d\.\w\'"]+', f'__version__ = "{now_date}"', init)
16-
with open(_PATH_INIT, 'w') as fp:
16+
with open(_PATH_INIT, "w") as fp:
1717
fp.write(init)
1818

1919
print(f"Update setup - replace version by {now_date} and update to c3-toolset-nightly")
20-
with open(_PATH_SETUP, 'r') as fp:
20+
with open(_PATH_SETUP, "r") as fp:
2121
setup = fp.read()
2222
setup = re.sub(r'version=[\d\.\w\'"]+', f'version="{now_date}"', setup)
23-
setup = re.sub(r'name="c3-toolset"', f'name="c3-toolset-nightly"', setup)
24-
with open(_PATH_SETUP, 'w') as fp:
25-
fp.write(setup)
23+
setup = re.sub(r'name="c3-toolset"', 'name="c3-toolset-nightly"', setup)
24+
with open(_PATH_SETUP, "w") as fp:
25+
fp.write(setup)

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## What
2+
Describe very concisely what this Pull Request does.
3+
4+
## Why
5+
Describe what motivated this Pull Request and why this was necessary. Use closing keywords to link to the relevant Issue. Ex. Closes #666
6+
7+
## How
8+
Describe details of how you implemented the solution, outlining the major steps involved in adding this new feature or fixing this bug. Provide code-snippets if possible, showing example usage.
9+
10+
## Remarks
11+
Add notes on possible known quirks/drawbacks of this solution. If this introduces an API-breaking change, please provide an explanation on why it is necessary to break API compatibility and how users should update their notebook/script workflows once this PR is merged.
12+
13+
## Checklist
14+
Please include and complete the following checklist. Your Pull Request is (in most cases) not ready for review until the following have been completed. You can create a draft PR while you are still completing the checklist. Check the [Contribution Guidelines](https://github.com/q-optimize/c3/blob/dev/CONTRIBUTING.md) for more details. You can mark an item as complete with the `- [x]` prefix
15+
16+
- [ ] Tests - Added unit tests for new code, regression tests for bugs and updated the integration tests if required
17+
- [ ] Formatting & Linting - `black` and `flake8` have been used to ensure styling guidelines are met
18+
- [ ] Type Annotations - All new code has been type annotated in the function signatures using type hints
19+
- [ ] Docstrings - Docstrings have been provided for functions in the `numpydoc` style
20+
- [ ] Documentation - The tutorial style documentation has been updated to explain changes & new features
21+
- [ ] Notebooks - Example notebooks have been updated to incorporate changes and new features
22+
- [ ] Changelog - A short note on this PR has been added to the Upcoming Release section

.github/workflows/build_package.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest]
16-
python-version: [3.6, 3.7, 3.8]
16+
python-version: [3.6, 3.7, 3.8, 3.9]
1717
env:
1818
OS: ${{ matrix.os }}
1919
PYTHON: ${{ matrix.python-version }}
@@ -26,16 +26,9 @@ jobs:
2626
- name: Install c3 package
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install pytest-cov qiskit==0.23.2
29+
pip install pytest qiskit==0.25.0
3030
pip install .
3131
- name: Test with pytest
3232
run: |
33-
pytest -v --cov=c3 --cov-report=xml test/
34-
- name: Upload build stats to Codecov
35-
uses: codecov/codecov-action@v1
36-
with:
37-
file: ./coverage.xml
38-
env_vars: OS,PYTHON
39-
name: build-c3
40-
fail_ci_if_error: false
41-
verbose: true
33+
pytest -v -x -m "not slow" test/
34+
pytest -v -x -m "slow" test/

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
build:
11+
coverage_check_upload:
1212

1313
runs-on: ubuntu-latest
1414
strategy:
@@ -29,7 +29,7 @@ jobs:
2929
pip install -r requirements.txt
3030
- name: Test with pytest
3131
run: |
32-
pytest -v --cov=c3 --cov-report=xml test/
32+
pytest -x -v --cov=c3 --cov-report=xml test/
3333
- name: Upload coverage to Codecov
3434
uses: codecov/codecov-action@v1
3535
with:

.github/workflows/complexity.yml renamed to .github/workflows/format_lint.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code Complexity
1+
name: Code Formatting and Linting
22

33
on:
44
push:
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
build:
11+
format_lint_check:
1212

1313
runs-on: ubuntu-latest
1414
strategy:
@@ -26,7 +26,11 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install -r requirements.txt
30-
- name: Test Complexity with Xenon
29+
pip install black flake8
30+
- name: Test Code Formatting with Black
3131
run: |
32-
xenon --max-absolute B --max-modules B --max-average A c3/
32+
black --check c3/
33+
- name: Code Linting with flake8
34+
run: |
35+
flake8 --count c3/
36+

.github/workflows/integration_test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
build:
11+
integration_unit_tests:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
1515
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest]
16-
python-version: [3.6, 3.7, 3.8]
16+
python-version: [3.6, 3.7, 3.8, 3.9]
1717
env:
1818
OS: ${{ matrix.os }}
1919
PYTHON: ${{ matrix.python-version }}
@@ -29,4 +29,5 @@ jobs:
2929
pip install -r requirements.txt
3030
- name: Test with pytest
3131
run: |
32-
pytest -v --cov=c3 test/
32+
pytest -v -x -m "not slow" test/
33+
pytest -v -x -m "slow" test/

.github/workflows/nightly_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
matrix:
5151
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest]
52-
python-version: [3.6, 3.7, 3.8]
52+
python-version: [3.6, 3.7, 3.8, 3.9]
5353
env:
5454
OS: ${{ matrix.os }}
5555
PYTHON: ${{ matrix.python-version }}

.github/workflows/notebook_test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Notebook Test
2+
3+
on:
4+
push:
5+
branches: [ master, dev, 'release/*' ]
6+
pull_request:
7+
branches: [ master, dev, 'release/*' ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
notebook_run_check:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
python-version: [3.8]
17+
env:
18+
OS: ${{ matrix.os }}
19+
PYTHON: ${{ matrix.python-version }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
pip install jupyter notebook ipykernel matplotlib
31+
pip install .
32+
- name: Test with nbconvert
33+
run: |
34+
jupyter nbconvert --to notebook --inplace --execute examples/*.ipynb

.github/workflows/publish_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
matrix:
4747
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest]
48-
python-version: [3.6, 3.7, 3.8]
48+
python-version: [3.6, 3.7, 3.8, 3.9]
4949
env:
5050
OS: ${{ matrix.os }}
5151
PYTHON: ${{ matrix.python-version }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,5 @@ dmypy.json
137137

138138
# swp files
139139
*.swp
140+
.stignore
141+
okteto.yml

.pre-commit-config.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
repos:
22
- repo: https://github.com/ambv/black
3-
rev: stable
3+
rev: 21.5b1
44
hooks:
55
- id: black
6-
language_version: python3.8
7-
- repo: https://gitlab.com/pycqa/flake8
8-
rev: 3.8.3
6+
language_version: python3
7+
- repo: https://github.com/pycqa/flake8
8+
rev: 3.9.2
99
hooks:
1010
- id: flake8
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: 'v0.790'
12+
rev: 'v0.812'
1313
hooks:
1414
- id: mypy
1515
args: [--no-strict-optional, --ignore-missing-imports]
1616
additional_dependencies: [cma==3.0.3,
17-
matplotlib==3.3.2,
18-
numpy==1.18.5,
17+
numpy==1.19.5,
1918
scipy==1.5.2,
20-
tensorflow==2.3.1,
21-
tensorflow-probability==0.11.1,
22-
tensorflow-estimator==2.3.0
19+
tensorflow==2.4.2,
20+
tensorflow-probability==0.12.1,
21+
tensorflow-estimator==2.4.0
2322
]

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Nicolas Wittler
33
Shai Machnes
44
Kevin Pack
55
Anurag Saha Roy
6+
Niklas J Glaser
67
Max Werninghaus

0 commit comments

Comments
 (0)