Skip to content

Commit e26b639

Browse files
committed
Update pre-commit... finally...
1 parent 6232ea7 commit e26b639

File tree

7 files changed

+28
-14
lines changed

7 files changed

+28
-14
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
skip: [mypy]
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v4.6.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
@@ -30,7 +30,7 @@ repos:
3030
- --wrap-summaries=80
3131
- --wrap-descriptions=80
3232
- repo: https://github.com/pre-commit/mirrors-autopep8
33-
rev: v2.0.2
33+
rev: v2.0.4
3434
hooks:
3535
- id: autopep8
3636
args:
@@ -39,13 +39,13 @@ repos:
3939
- --ignore=E731
4040
exclude: 'tests/ext.*'
4141
- repo: https://github.com/asottile/pyupgrade
42-
rev: v3.10.1
42+
rev: v3.17.0
4343
hooks:
4444
- id: pyupgrade
4545
args:
4646
- --py38-plus
4747
- repo: https://github.com/asottile/reorder_python_imports
48-
rev: v3.10.0
48+
rev: v3.13.0
4949
hooks:
5050
- id: reorder-python-imports
5151
args:
@@ -54,25 +54,25 @@ repos:
5454
- --py37-plus
5555
exclude: 'tests/ext.*'
5656
- repo: https://github.com/asottile/add-trailing-comma
57-
rev: v3.0.1
57+
rev: v3.1.0
5858
hooks:
5959
- id: add-trailing-comma
6060
args:
6161
- --py36-plus
6262
- repo: https://github.com/PyCQA/autoflake
63-
rev: v2.2.0
63+
rev: v2.3.1
6464
hooks:
6565
- id: autoflake
6666
args:
6767
- --in-place
6868
- repo: https://github.com/pre-commit/mirrors-mypy
69-
rev: v1.5.0
69+
rev: v1.11.1
7070
hooks:
7171
- id: mypy
7272
exclude: tests/qis/test_pauli.py
7373
additional_dependencies: ["numpy>=1.21"]
7474
- repo: https://github.com/PyCQA/flake8
75-
rev: 6.1.0
75+
rev: 7.1.1
7676
hooks:
7777
- id: flake8
7878
args:

bqskit/ext/qiskit/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def model_from_backend(backend: BackendV1) -> MachineModel:
2323
num_qudits = config.n_qubits
2424
gate_set = _basis_gate_str_to_bqskit_gate(config.basis_gates)
2525
coupling_map = list({tuple(sorted(e)) for e in config.coupling_map})
26-
return MachineModel(num_qudits, coupling_map, gate_set) # type: ignore
26+
return MachineModel(num_qudits, coupling_map, gate_set)
2727

2828

2929
def _basis_gate_str_to_bqskit_gate(basis_gates: list[str]) -> set[Gate]:

bqskit/ir/interval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __new__(
8989
'Expected positive integers, got {lower} and {upper}.',
9090
)
9191

92-
return super().__new__(cls, (lower, upper)) # type: ignore
92+
return super().__new__(cls, (lower, upper))
9393

9494
@property
9595
def lower(self) -> int:

bqskit/ir/point.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __new__(
6666
else:
6767
raise TypeError('Expected two integer arguments.')
6868

69-
return super().__new__(cls, (cycle, qudit)) # type: ignore
69+
return super().__new__(cls, (cycle, qudit))
7070

7171
@property
7272
def cycle(self) -> int:

bqskit/qis/state/state.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,8 @@ def __repr__(self) -> str:
433433
return repr(self._vec)
434434

435435

436-
StateLike = Union[StateVector, np.ndarray, Sequence[Union[int, float, complex]]]
436+
StateLike = Union[
437+
StateVector,
438+
npt.NDArray[np.complex128],
439+
Sequence[Union[int, float, complex]],
440+
]

bqskit/qis/unitary/unitary.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Union
88

99
import numpy as np
10+
import numpy.typing as npt
1011

1112
from bqskit.qis.unitary.meta import UnitaryMeta
1213
from bqskit.utils.typing import is_real_number
@@ -151,4 +152,8 @@ def is_self_inverse(self, params: RealVector = []) -> bool:
151152
return np.allclose(unitary_matrix, hermitian_conjugate)
152153

153154

154-
RealVector = Union[Sequence[float], np.ndarray]
155+
RealVector = Union[
156+
Sequence[float],
157+
npt.NDArray[np.float64],
158+
npt.NDArray[np.float32],
159+
]

bqskit/qis/unitary/unitarymatrix.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ def __hash__(self) -> int:
540540

541541
UnitaryLike = Union[
542542
UnitaryMatrix,
543-
np.ndarray,
543+
npt.NDArray[np.complex128],
544+
npt.NDArray[np.complex64],
545+
npt.NDArray[np.int64],
546+
npt.NDArray[np.int32],
547+
npt.NDArray[np.float64],
548+
npt.NDArray[np.float32],
544549
Sequence[Sequence[Union[int, float, complex]]],
545550
]

0 commit comments

Comments
 (0)