cirq-core 1.5.0.dev20240927180019__py3-none-any.whl → 1.5.0.dev20241002233716__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cirq-core might be problematic. Click here for more details.
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/testing/__init__.py +2 -1
- cirq/testing/{pytest_randomly_utils.py → pytest_utils.py} +19 -0
- cirq/testing/{pytest_randomly_utils_test.py → pytest_utils_test.py} +8 -0
- {cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/RECORD +10 -10
- {cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
cirq/testing/__init__.py
CHANGED
|
@@ -115,7 +115,8 @@ from cirq.testing.op_tree import assert_equivalent_op_tree as assert_equivalent_
|
|
|
115
115
|
|
|
116
116
|
from cirq.testing.order_tester import OrderTester as OrderTester
|
|
117
117
|
|
|
118
|
-
from cirq.testing.
|
|
118
|
+
from cirq.testing.pytest_utils import (
|
|
119
|
+
retry_once_after_timeout as retry_once_after_timeout,
|
|
119
120
|
retry_once_with_later_random_values as retry_once_with_later_random_values,
|
|
120
121
|
)
|
|
121
122
|
|
|
@@ -19,6 +19,25 @@ import warnings
|
|
|
19
19
|
from typing import Any, Callable
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
def retry_once_after_timeout(testfunc: Callable) -> Callable:
|
|
23
|
+
"""Marks a test function for one retry if it fails with TimeoutError.
|
|
24
|
+
|
|
25
|
+
This decorator is intended for test functions which occasionally fail
|
|
26
|
+
with TimeoutError.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
@functools.wraps(testfunc)
|
|
30
|
+
def wrapped_func(*args, **kwargs) -> Any:
|
|
31
|
+
try:
|
|
32
|
+
return testfunc(*args, **kwargs)
|
|
33
|
+
except TimeoutError:
|
|
34
|
+
pass
|
|
35
|
+
warnings.warn("Retrying in case we have a transitive TimeoutError")
|
|
36
|
+
return testfunc(*args, **kwargs)
|
|
37
|
+
|
|
38
|
+
return wrapped_func
|
|
39
|
+
|
|
40
|
+
|
|
22
41
|
def retry_once_with_later_random_values(testfunc: Callable) -> Callable:
|
|
23
42
|
"""Marks a test function for one retry with later random values.
|
|
24
43
|
|
|
@@ -19,6 +19,14 @@ import pytest
|
|
|
19
19
|
import cirq
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
def test_retry_once_after_timeout():
|
|
23
|
+
testfunc = Mock(side_effect=[TimeoutError("first call fails"), None])
|
|
24
|
+
decoratedfunc = cirq.testing.retry_once_after_timeout(testfunc)
|
|
25
|
+
with pytest.warns(UserWarning, match="Retrying.*transitive TimeoutError"):
|
|
26
|
+
decoratedfunc()
|
|
27
|
+
assert testfunc.call_count == 2
|
|
28
|
+
|
|
29
|
+
|
|
22
30
|
def test_retry_once_with_later_random_values():
|
|
23
31
|
testfunc = Mock(side_effect=[AssertionError("first call fails"), None])
|
|
24
32
|
decoratedfunc = cirq.testing.retry_once_with_later_random_values(testfunc)
|
{cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev20241002233716
|
|
4
4
|
Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
{cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=Qq3ZcfgD-Nb81cEppQdJqhAyrVqXKtfXZYGXT0p-Wh0,34718
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=p9gMHJscbtDDkfHOaulvd3Aer0pwUF5AXpL89XR8dNw,8402
|
|
6
6
|
cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=2DlrR3naBFSmdoRBfmIh98HV7R9AMcb_kTce1umh_PE,1206
|
|
8
|
+
cirq/_version_test.py,sha256=NZbUTk8v7zt2CI6IS_nymuxF3T0x4DHWVA7Zeye-nrU,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=ytePZtNZgKjOF2NiVpUTuotB-JKZmQNOFIFdvXqsxHw,13271
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -943,7 +943,7 @@ cirq/study/sweepable.py,sha256=hHBXn5MQZJawiiIXWZdn_qygbPeIFtt300wIqVHiYl8,4356
|
|
|
943
943
|
cirq/study/sweepable_test.py,sha256=ENv03_GJmbUc_ukJoqfgG-H5C_yyx1jCcvxohSMyQVU,5502
|
|
944
944
|
cirq/study/sweeps.py,sha256=zKz8hmLnpukNzUp7YjsrD8wEGxf2peX19522kUKUfWI,19850
|
|
945
945
|
cirq/study/sweeps_test.py,sha256=YdXHzZO10OHoPTU2ifmsfH7KByIJeeANy91AHqX8nwg,12135
|
|
946
|
-
cirq/testing/__init__.py,sha256=
|
|
946
|
+
cirq/testing/__init__.py,sha256=m_HUdHcJ3HcKpGQBKCwZ6E6QSkKpIN-dUGr4e75o4tY,6217
|
|
947
947
|
cirq/testing/circuit_compare.py,sha256=nBQES45wLVThOqC3WrPrYKLQP7HQ2pH5DjlJ5bHkrtU,19176
|
|
948
948
|
cirq/testing/circuit_compare_test.py,sha256=AduZCzwBNFCYrjEpyS1DvIR6jU8GaFqQBBgPXyIALoU,19743
|
|
949
949
|
cirq/testing/consistent_act_on.py,sha256=ofYxdotw7fDfEVaAoM3NJEG2-hTHmi5FlLZkLYfVBWE,7733
|
|
@@ -991,8 +991,8 @@ cirq/testing/op_tree.py,sha256=fb3bOoTihGWp_NvPHekI7s9YZIaBoiufDVhh4ARCfhQ,954
|
|
|
991
991
|
cirq/testing/op_tree_test.py,sha256=MwDpi5Lw1e3Y_-9Psx9MPvbbW2x4JlOpp7hl8mBvOQA,1073
|
|
992
992
|
cirq/testing/order_tester.py,sha256=0_tfixWyX_HrjTXpNrVFZT9bA6J585Ad8tjS-DsX8yU,6690
|
|
993
993
|
cirq/testing/order_tester_test.py,sha256=2mifnUW_BT17jwWZjmM9p7EoJjq0Ouz54o3G8BqvDqw,5111
|
|
994
|
-
cirq/testing/
|
|
995
|
-
cirq/testing/
|
|
994
|
+
cirq/testing/pytest_utils.py,sha256=I3R5oGjZpoc2eWzEVU940hnDLwlDlD5cSa9-B4le-1I,1920
|
|
995
|
+
cirq/testing/pytest_utils_test.py,sha256=LbgQP5UrMapU8iB53DzBdtg69lGKnfCIjGM-yJzEp54,1314
|
|
996
996
|
cirq/testing/random_circuit.py,sha256=oMoz0_VWWVmUGmJ9mu1R7NByNKtSadxdLjFyDEE1qT0,5900
|
|
997
997
|
cirq/testing/random_circuit_test.py,sha256=x0ovYOIc3-QNKFjCc87LbLkWNwFZKx6T97ZCN3QGRsI,7026
|
|
998
998
|
cirq/testing/repr_pretty_tester.py,sha256=dtk713qmE87Biaez3c8R83Wb7tlb4xWFfzt44iKkbto,2899
|
|
@@ -1184,8 +1184,8 @@ cirq/work/sampler.py,sha256=JEAeQQRF3bqlO9AkOf4XbrTATDI5f5JgyM_FAUCNxao,19751
|
|
|
1184
1184
|
cirq/work/sampler_test.py,sha256=B2ZsuqGT854gQtBIAh8k0LiG9Vj5wSzcGvkxOUoTcW4,13217
|
|
1185
1185
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1186
1186
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1187
|
-
cirq_core-1.5.0.
|
|
1188
|
-
cirq_core-1.5.0.
|
|
1189
|
-
cirq_core-1.5.0.
|
|
1190
|
-
cirq_core-1.5.0.
|
|
1191
|
-
cirq_core-1.5.0.
|
|
1187
|
+
cirq_core-1.5.0.dev20241002233716.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1188
|
+
cirq_core-1.5.0.dev20241002233716.dist-info/METADATA,sha256=hDvyFY1ZVOFLecgxK_ilp4J1J67LTx1w29VK8cRj6Aw,1992
|
|
1189
|
+
cirq_core-1.5.0.dev20241002233716.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
1190
|
+
cirq_core-1.5.0.dev20241002233716.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1191
|
+
cirq_core-1.5.0.dev20241002233716.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20240927180019.dist-info → cirq_core-1.5.0.dev20241002233716.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|