Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pavoljuhas authored Apr 25, 2024
2 parents 2b182e2 + 5828147 commit 32a7bb2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11']
runs-on: macos-latest
# TODO(#6577): upgrade to macos-latest when it runs Python 3.10
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ jobs:
strategy:
matrix:
python-version: [ '3.10', '3.11' ]
runs-on: macos-latest
# TODO(#6577): upgrade to macos-latest when it runs Python 3.10
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
2 changes: 0 additions & 2 deletions cirq-core/cirq/study/sweeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ def keys(self) -> List['cirq.TParamKey']:
return sum((factor.keys for factor in self.factors), [])

def __len__(self) -> int:
if not self.factors:
return 0
length = 1
for factor in self.factors:
length *= len(factor)
Expand Down
5 changes: 5 additions & 0 deletions cirq-core/cirq/study/sweeps_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ def test_product():
assert _values(sweep, 'b') == [4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7]


def test_empty_product():
sweep = cirq.Product()
assert len(sweep) == len(list(sweep)) == 1


def test_slice_access_error():
sweep = cirq.Points('a', [1, 2, 3])
with pytest.raises(TypeError, match='<class \'str\'>'):
Expand Down

0 comments on commit 32a7bb2

Please sign in to comment.