Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix __len__ of empty Product sweep to match actual length #6575

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

maffoo
Copy link
Contributor

@maffoo maffoo commented Apr 25, 2024

An empty cirq.Product() sweep yields one empty param resolver, but was reporting a length of 0 when calling __len__. This fixes the __len__ computation so it agrees with the actual length of the sweep when iterating.

@maffoo maffoo requested review from vtomole, cduck and a team as code owners April 25, 2024 03:46
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.79%. Comparing base (e1b03ef) to head (fb4a64a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6575   +/-   ##
=======================================
  Coverage   97.79%   97.79%           
=======================================
  Files        1124     1124           
  Lines       95684    95685    +1     
=======================================
+ Hits        93574    93576    +2     
+ Misses       2110     2109    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maffoo maffoo enabled auto-merge (squash) April 25, 2024 18:01
@maffoo maffoo merged commit 5828147 into main Apr 25, 2024
34 checks passed
@maffoo maffoo deleted the u/maffoo/sweep-len branch April 25, 2024 19:52
jselig-rigetti pushed a commit to jselig-rigetti/Cirq that referenced this pull request May 28, 2024
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants