Skip to content

Commit 477d356

Browse files
committed
fix some lint
1 parent 2f3d637 commit 477d356

File tree

234 files changed

+2902
-3016
lines changed

Some content is hidden

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

234 files changed

+2902
-3016
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ select = B,C,E,F,N,P,T4,W,B9
33
max-line-length = 120
44
ignore =
55
E203,E305,E402,E501,E721,E741,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,N812,N817,E731
6-
EXE001,
6+
EXE001, F403,
77
B007,B008,
88
optional-ascii-coding = True
99
exclude =

.github/workflows/functional_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Python package
55

66
on:
7-
push:
7+
push:
88
pull_request:
99

1010
jobs:

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55

66
env:
7-
PYTHON_VERSION: "3.8"
7+
PYTHON_VERSION: "3.9"
88

99
defaults:
1010
run:
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Setup Python 3.8
18+
- name: Setup Python 3.9
1919
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ env.PYTHON_VERSION }}

.github/workflows/pull_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pull Request
33
on: [pull_request]
44

55
env:
6-
PYTHON_VERSION: "3.8"
6+
PYTHON_VERSION: "3.9"
77

88
jobs:
99
pre-commit:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,4 @@ model.pt
347347

348348
.cursorignore
349349
.cursor/
350-
.github/copilot-instructions.md
350+
.github/copilot-instructions.md

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ repos:
4040
rev: 22.12.0
4141
hooks:
4242
- id: black
43-
language_version: python3.8
43+
language_version: python3.12
4444

4545
- repo: https://github.com/PyCQA/flake8
4646
rev: 6.0.0
@@ -53,7 +53,7 @@ repos:
5353
hooks:
5454
- id: codespell
5555
args: [
56-
'--ignore-words-list=reord,dout,nd,te,ser',
56+
'--ignore-words-list=reord,dout,nd,te,ser,fO,ot,Bu,bu,Ths,UE,Ue,tye,HEl,FO,VeW,WHan,fo,Ot,fPr,bU,GES,uE,Acn',
5757
--check-filenames,
5858
--check-hidden,
5959
]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ print(op.params.grad)
134134

135135
# Apply gates to qdev with tq.QuantumModule
136136
ops = [
137-
{'name': 'hadamard', 'wires': 0},
137+
{'name': 'hadamard', 'wires': 0},
138138
{'name': 'cnot', 'wires': [0, 1]},
139139
{'name': 'rx', 'wires': 0, 'params': 0.5, 'trainable': True},
140140
{'name': 'u3', 'wires': 0, 'params': [0.1, 0.2, 0.3], 'trainable': True},
@@ -271,7 +271,7 @@ python mnist.py
271271
| measure.py | Measurement of quantum states to get classical values |
272272
| graph.py | Quantum gate graph used in static mode |
273273
| super_layer.py | Layer templates for SuperCircuits |
274-
| plugins/qiskit* | Convertors and processors for easy deployment on IBMQ |
274+
| plugins/qiskit* | Converters and processors for easy deployment on IBMQ |
275275
| examples/| More examples for training QML and VQE models |
276276

277277
## Coding Style

docs/source/conf.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,31 @@
2828
# add these directories to sys.path here.
2929
import sys
3030
import os
31-
sys.path.insert(0, os.path.abspath('../..'))
3231

33-
#import pathlib
34-
#sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
32+
sys.path.insert(0, os.path.abspath("../.."))
33+
34+
# import pathlib
35+
# sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
3536

3637
# -- Project information
3738

38-
project = 'TorchQuantum'
39-
copyright = '2021, Hanrui Wang'
40-
author = 'Hanrui Wang'
39+
project = "TorchQuantum"
40+
copyright = "2021, Hanrui Wang"
41+
author = "Hanrui Wang"
4142

42-
release = '0.1'
43-
version = '0.1.0'
43+
release = "0.1"
44+
version = "0.1.0"
4445

4546
# -- General configuration
4647

4748
extensions = [
48-
'sphinx.ext.duration',
49-
'sphinx.ext.doctest',
50-
'sphinx.ext.autodoc',
51-
'sphinx.ext.autosummary',
52-
'sphinx.ext.intersphinx',
53-
'sphinx.ext.napoleon', # google styled docstring
54-
'sphinx.ext.viewcode', # [source] link to view code
49+
"sphinx.ext.duration",
50+
"sphinx.ext.doctest",
51+
"sphinx.ext.autodoc",
52+
"sphinx.ext.autosummary",
53+
"sphinx.ext.intersphinx",
54+
"sphinx.ext.napoleon", # google styled docstring
55+
"sphinx.ext.viewcode", # [source] link to view code
5556
# 'sphinx.ext.todo',
5657
# 'sphinx.ext.coverage',
5758
# 'sphinxcontrib.katex',
@@ -62,19 +63,19 @@
6263
# 'sphinx.ext.extlinks',
6364
# 'sphinx_autodoc_typehints',
6465
# 'jupyter_sphinx',
65-
'nbsphinx', # support for including Jupyter Notebook (*.ipynb) file
66-
'recommonmark', # support for including markdown (*.md) file
66+
"nbsphinx", # support for including Jupyter Notebook (*.ipynb) file
67+
"recommonmark", # support for including markdown (*.md) file
6768
# 'sphinx_design',
6869
# 'sphinx_reredirects'
6970
]
7071

7172
intersphinx_mapping = {
72-
'python': ('https://docs.python.org/3/', None),
73-
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
73+
"python": ("https://docs.python.org/3/", None),
74+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
7475
}
75-
intersphinx_disabled_domains = ['std']
76+
intersphinx_disabled_domains = ["std"]
7677

77-
templates_path = ['_templates']
78+
templates_path = ["_templates"]
7879

7980
# -- Options for HTML output
8081

@@ -142,12 +143,12 @@
142143
}
143144
"""
144145

145-
html_theme = 'furo'
146+
html_theme = "furo"
146147
html_theme_options = {
147-
'collapse_navigation': False,
148-
'display_version': True,
149-
'logo_only': False,
150-
"index": "page.html"
148+
"collapse_navigation": False,
149+
"display_version": True,
150+
"logo_only": False,
151+
"index": "page.html",
151152
}
152153

153154
# adjust code block style for readthedocs
@@ -159,4 +160,4 @@
159160
display_gitlab = False
160161
show_source = True
161162
# -- Options for EPUB output
162-
epub_show_urls = 'footnote'
163+
epub_show_urls = "footnote"

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Files
309309
+-----------------------------------+-----------------------------------+
310310
| super_layer.py | Layer templates for SuperCircuits |
311311
+-----------------------------------+-----------------------------------+
312-
| plugins/qiskit\* | Convertors and processors for |
312+
| plugins/qiskit\* | Converters and processors for |
313313
| | easy deployment on IBMQ |
314314
+-----------------------------------+-----------------------------------+
315315
| examples/ | More examples for training QML |

examples/ICCAD22_tutorial/sec1_basic.ipynb

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)