Skip to content

Commit 32a7bb2

Browse files
authored
Merge branch 'main' into main
2 parents 2b182e2 + 5828147 commit 32a7bb2

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.github/workflows/ci-daily.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ jobs:
7171
strategy:
7272
matrix:
7373
python-version: ['3.10', '3.11']
74-
runs-on: macos-latest
74+
# TODO(#6577): upgrade to macos-latest when it runs Python 3.10
75+
runs-on: macos-13
7576
steps:
7677
- uses: actions/checkout@v4
7778
- uses: actions/setup-python@v5

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ jobs:
260260
strategy:
261261
matrix:
262262
python-version: [ '3.10', '3.11' ]
263-
runs-on: macos-latest
263+
# TODO(#6577): upgrade to macos-latest when it runs Python 3.10
264+
runs-on: macos-13
264265
steps:
265266
- uses: actions/checkout@v4
266267
- uses: actions/setup-python@v5

cirq-core/cirq/study/sweeps.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ def keys(self) -> List['cirq.TParamKey']:
236236
return sum((factor.keys for factor in self.factors), [])
237237

238238
def __len__(self) -> int:
239-
if not self.factors:
240-
return 0
241239
length = 1
242240
for factor in self.factors:
243241
length *= len(factor)

cirq-core/cirq/study/sweeps_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ def test_product():
142142
assert _values(sweep, 'b') == [4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7]
143143

144144

145+
def test_empty_product():
146+
sweep = cirq.Product()
147+
assert len(sweep) == len(list(sweep)) == 1
148+
149+
145150
def test_slice_access_error():
146151
sweep = cirq.Points('a', [1, 2, 3])
147152
with pytest.raises(TypeError, match='<class \'str\'>'):

0 commit comments

Comments
 (0)