Skip to content

Commit 439ffd5

Browse files
[pre-commit.ci] pre-commit autoupdate (#458)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0) * Update CHANGELOG and keep flake8 5.0.4 for pre-commit hooks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Damien Nguyen <ngn.damien@gmail.com>
1 parent 9f21982 commit 439ffd5

File tree

10 files changed

+11
-13
lines changed

10 files changed

+11
-13
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ repos:
8585
name: isort (python)
8686

8787
- repo: https://github.com/psf/black
88-
rev: 22.12.0
88+
rev: 23.1.0
8989
hooks:
9090
- id: black
9191
language_version: python3

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Update to clang-tidy 14 in GitHub workflow
2020
- Added new pre-commit hooks: `codespell`, `doc8`, `pydocstyle` and `yamllint`
2121
- Update pre-commit hook versions
22-
- Keep `flake8` hook to version 5.0.4 until plugin support Flake8 6.X
22+
- Keep `flake8` hook to version 5.0.4 until plugins support Flake8 6.X
2323
- Disable `no-member` warning for Pylint on pre-commit CI
2424

2525
## [v0.8.0] - 2022-10-18

projectq/backends/_aqt/_aqt_http_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def _handle_sigint_during_get_result(*_): # pragma: no cover
136136
signal.signal(signal.SIGINT, _handle_sigint_during_get_result)
137137

138138
for retries in range(num_retries):
139-
140139
argument = {'id': execution_id, 'access_token': self.token}
141140
req = super().put(urljoin(_API_URL, self.backends[device]['url']), data=argument)
142141
req.raise_for_status()

projectq/backends/_awsbraket/_awsbraket_boto3_client_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def test_send_too_many_qubits(mocker, send_too_many_setup):
180180
],
181181
)
182182
def test_send_real_device_online_verbose(mocker, var_status, var_result, real_device_online_setup):
183-
184183
(
185184
qtarntask,
186185
creds,
@@ -285,7 +284,6 @@ def test_send_that_errors_are_caught(mocker, var_error, send_that_error_setup):
285284
@has_boto3
286285
@pytest.mark.parametrize("var_error", [('ResourceNotFoundException')])
287286
def test_retrieve_error_arn_not_exist(mocker, var_error, arntask, creds):
288-
289287
mock_boto3_client = mocker.MagicMock(spec=['get_quantum_task'])
290288
mock_boto3_client.get_quantum_task.side_effect = botocore.exceptions.ClientError(
291289
{"Error": {"Code": var_error, "Message": f"Msg error for {var_error}"}},

projectq/backends/_ibm/_ibm_http_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ def _handle_sigint_during_get_result(*_): # pragma: no cover
228228
try:
229229
signal.signal(signal.SIGINT, _handle_sigint_during_get_result)
230230
for retries in range(num_retries):
231-
232231
# STEP5: WAIT FOR THE JOB TO BE RUN
233232
json_step5 = {'allow_redirects': True, 'timeout': (self.timeout, None)}
234233
request = super().get(urljoin(_API_URL, job_status_url), **json_step5)

projectq/backends/_ionq/_ionq.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ def _store(self, cmd):
205205
targets = [qb.id for qureg in cmd.qubits for qb in qureg]
206206
controls = [qb.id for qb in cmd.control_qubits]
207207
if len(self._measured_ids) > 0:
208-
209208
# Check any qubits we are trying to operate on.
210209
gate_qubits = set(targets) | set(controls)
211210

projectq/backends/_sim/_pysim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def get_expectation_value(self, terms_dict, ids):
236236
"""
237237
expectation = 0.0
238238
current_state = _np.copy(self._state)
239-
for (term, coefficient) in terms_dict:
239+
for term, coefficient in terms_dict:
240240
self._apply_term(term, ids)
241241
delta = coefficient * _np.vdot(current_state, self._state).real
242242
expectation += delta
@@ -253,7 +253,7 @@ def apply_qubit_operator(self, terms_dict, ids):
253253
"""
254254
new_state = _np.zeros_like(self._state)
255255
current_state = _np.copy(self._state)
256-
for (term, coefficient) in terms_dict:
256+
for term, coefficient in terms_dict:
257257
self._apply_term(term, ids)
258258
self._state *= coefficient
259259
new_state += self._state

projectq/setups/awsbraket_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
@patch('boto3.client')
133133
@pytest.mark.parametrize("var_device", ['SV1', 'Aspen-8', 'IonQ Device'])
134134
def test_awsbraket_get_engine_list(mock_boto3_client, var_device):
135-
136135
mock_boto3_client.return_value = mock_boto3_client
137136
mock_boto3_client.search_devices.return_value = search_value
138137
mock_boto3_client.get_device.return_value = device_value
@@ -144,7 +143,6 @@ def test_awsbraket_get_engine_list(mock_boto3_client, var_device):
144143
@has_boto3
145144
@patch('boto3.client')
146145
def test_awsbraket_error(mock_boto3_client):
147-
148146
mock_boto3_client.return_value = mock_boto3_client
149147
mock_boto3_client.search_devices.return_value = search_value
150148
mock_boto3_client.get_device.return_value = device_value

projectq/setups/trapped_ion_decomposer_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def test_chooser_Ry_reducer():
138138
),
139139
(get_engine_list(), 11),
140140
]:
141-
142141
backend = DummyEngine(save_commands=True)
143142
eng = projectq.MainEngine(backend, engine_list, verbose=True)
144143
qubit1 = eng.allocate_qubit()

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,13 @@ def build_extensions(self):
380380

381381
def _get_compilation_commands(self, ext):
382382
# pylint: disable=protected-access
383-
(_, objects, extra_postargs, pp_opts, build,) = self.compiler._setup_compile(
383+
(
384+
_,
385+
objects,
386+
extra_postargs,
387+
pp_opts,
388+
build,
389+
) = self.compiler._setup_compile(
384390
outdir=self.build_temp,
385391
sources=ext.sources,
386392
macros=ext.define_macros,

0 commit comments

Comments
 (0)