Commit 1dae57c 1 parent c82198b commit 1dae57c Copy full SHA for 1dae57c
File tree 10 files changed +24
-39
lines changed
10 files changed +24
-39
lines changed Original file line number Diff line number Diff line change 41
41
42
42
### Bug fixes
43
43
44
+ * Specify ` isort ` ` --py ` (Python version) and ` -l ` (max line length) to stabilize ` isort ` across Python versions and environments.
45
+ [ (#647 )] ( https://github.com/PennyLaneAI/pennylane-lightning/pull/647 )
46
+
44
47
* Fix random ` coverage xml ` CI issues.
45
48
[ (#635 )] ( https://github.com/PennyLaneAI/pennylane-lightning/pull/635 )
46
49
Original file line number Diff line number Diff line change 26
26
- name : Checkout PennyLane-Lightning
27
27
uses : actions/checkout@v3
28
28
29
- - name : Run isort
30
- run : python -m isort --profile black ./pennylane_lightning/ ./mpitests ./tests --check --diff
31
-
32
- - name : Run Black
33
- run : python -m black -l 100 pennylane_lightning/ tests/ --check --verbose
29
+ - name : Run isort & black --check
30
+ run : make format-python check=1 verbose=1
34
31
35
32
format-cpp :
36
33
name : Format (C++)
62
59
- name : Set up Python
63
60
uses : actions/setup-python@v4
64
61
with :
65
- python-version : ' 3.9 '
62
+ python-version : ' 3.11 '
66
63
67
64
- name : Install dependencies
68
65
run : sudo apt update && sudo apt -y install cmake gcc-11 g++-11 ninja-build libomp-14-dev && python -m pip install -r requirements-dev.txt
Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ TESTRUNNER := -m pytest tests --tb=short
5
5
PL_BACKEND ?= "$(if $(backend:-= ) ,$(backend ) ,lightning_qubit) "
6
6
7
7
ifdef check
8
- CHECK := --check
8
+ CHECK := --check --diff
9
+ ICHECK := --check
9
10
else
10
11
CHECK :=
12
+ ICHECK :=
11
13
endif
12
14
13
15
ifdef build_options
@@ -113,8 +115,8 @@ format-cpp:
113
115
./bin/format $(CHECK ) ./pennylane_lightning
114
116
115
117
format-python :
116
- isort --profile black ./pennylane_lightning/ ./mpitests ./tests $(CHECK )
117
- black -l 100 ./pennylane_lightning/ ./mpitests ./tests $(CHECK )
118
+ isort --py 311 -- profile black -l 100 -p pennylane_lightning ./pennylane_lightning/ ./mpitests ./tests $(ICHECK ) $( VERBOSE )
119
+ black -l 100 ./pennylane_lightning/ ./mpitests ./tests $(CHECK ) $( VERBOSE )
118
120
119
121
.PHONY : check-tidy
120
122
check-tidy :
Original file line number Diff line number Diff line change 16
16
Version number (major.minor.patch[-label])
17
17
"""
18
18
19
- __version__ = "0.36.0-dev14 "
19
+ __version__ = "0.36.0-dev15 "
Original file line number Diff line number Diff line change 91
91
from pennylane .ops .op_math import Adjoint
92
92
from pennylane .wires import Wires
93
93
94
+ # pylint: disable=import-error, no-name-in-module, ungrouped-imports
95
+ from pennylane_lightning .core ._serialize import QuantumScriptSerializer , global_phase_diagonal
96
+ from pennylane_lightning .core ._version import __version__
97
+
94
98
# pylint: disable=no-name-in-module, ungrouped-imports
95
99
from pennylane_lightning .lightning_gpu_ops .algorithms import (
96
100
AdjointJacobianC64 ,
99
103
create_ops_listC128 ,
100
104
)
101
105
102
- # pylint: disable=import-error, no-name-in-module, ungrouped-imports
103
- from pennylane_lightning .core ._serialize import (
104
- QuantumScriptSerializer ,
105
- global_phase_diagonal ,
106
- )
107
- from pennylane_lightning .core ._version import __version__
108
-
109
106
if MPI_SUPPORT :
110
107
from pennylane_lightning .lightning_gpu_ops .algorithmsMPI import (
111
108
AdjointJacobianMPIC64 ,
Original file line number Diff line number Diff line change 64
64
from pennylane .ops .op_math import Adjoint
65
65
from pennylane .wires import Wires
66
66
67
+ # pylint: disable=import-error, no-name-in-module, ungrouped-imports
68
+ from pennylane_lightning .core ._serialize import QuantumScriptSerializer , global_phase_diagonal
69
+ from pennylane_lightning .core ._version import __version__
70
+
67
71
# pylint: disable=import-error, no-name-in-module, ungrouped-imports
68
72
from pennylane_lightning .lightning_kokkos_ops .algorithms import (
69
73
AdjointJacobianC64 ,
72
76
create_ops_listC128 ,
73
77
)
74
78
75
- # pylint: disable=import-error, no-name-in-module, ungrouped-imports
76
- from pennylane_lightning .core ._serialize import (
77
- QuantumScriptSerializer ,
78
- global_phase_diagonal ,
79
- )
80
- from pennylane_lightning .core ._version import __version__
81
-
82
79
def _kokkos_dtype (dtype ):
83
80
if dtype not in [np .complex128 , np .complex64 ]: # pragma: no cover
84
81
raise ValueError (f"Data type is not supported for state-vector computation: { dtype } " )
Original file line number Diff line number Diff line change 17
17
18
18
# pylint: disable=import-error, no-name-in-module, ungrouped-imports
19
19
try :
20
- from pennylane_lightning .lightning_qubit_ops import (
21
- MeasurementsC64 ,
22
- MeasurementsC128 ,
23
- )
20
+ from pennylane_lightning .lightning_qubit_ops import MeasurementsC64 , MeasurementsC128
24
21
except ImportError :
25
22
pass
26
23
Original file line number Diff line number Diff line change 23
23
from pennylane .tape import QuantumScript
24
24
from scipy .stats import unitary_group
25
25
26
- from pennylane_lightning .lightning_qubit ._adjoint_jacobian import (
27
- LightningAdjointJacobian ,
28
- )
26
+ from pennylane_lightning .lightning_qubit ._adjoint_jacobian import LightningAdjointJacobian
29
27
from pennylane_lightning .lightning_qubit ._state_vector import LightningStateVector
30
28
31
29
if not LightningDevice ._new_API :
Original file line number Diff line number Diff line change 26
26
from scipy .sparse import csr_matrix , random_array
27
27
28
28
try :
29
- from pennylane_lightning .lightning_qubit_ops import (
30
- MeasurementsC64 ,
31
- MeasurementsC128 ,
32
- )
29
+ from pennylane_lightning .lightning_qubit_ops import MeasurementsC64 , MeasurementsC128
33
30
except ImportError :
34
31
pass
35
32
Original file line number Diff line number Diff line change 19
19
import pytest
20
20
from conftest import LightningDevice , device_name
21
21
22
- from pennylane_lightning .core ._serialize import (
23
- QuantumScriptSerializer ,
24
- global_phase_diagonal ,
25
- )
22
+ from pennylane_lightning .core ._serialize import QuantumScriptSerializer , global_phase_diagonal
26
23
27
24
if not LightningDevice ._CPP_BINARY_AVAILABLE :
28
25
pytest .skip ("No binary module found. Skipping." , allow_module_level = True )
You can’t perform that action at this time.
0 commit comments