Skip to content

Add boolean support to cirq_google protos #7177

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

Merged
merged 5 commits into from
Mar 24, 2025

Conversation

dstrain115
Copy link
Collaborator

No description provided.

@dstrain115 dstrain115 requested review from wcourtney, vtomole, verult and a team as code owners March 22, 2025 22:53
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (eb51ddc) to head (f56bb61).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7177      +/-   ##
==========================================
- Coverage   98.13%   98.13%   -0.01%     
==========================================
  Files        1097     1097              
  Lines       95658    95662       +4     
==========================================
+ Hits        93876    93878       +2     
- Misses       1782     1784       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dstrain115 dstrain115 requested a review from senecameeks March 24, 2025 13:57
@@ -420,6 +420,7 @@ message ArgValue {
RepeatedDouble double_values = 6;
RepeatedString string_values = 7;
tunits.Value value_with_unit = 8;
bool bool_value = 9;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we move this field next to bool_values for better discoverability in the future. (I'm aware this convention hasn't been done before.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's a good idea. I think it's generally better to keep things in order of field id unless there's a really good reason. Otherwise, it gets more confusing to add fields.

@@ -128,7 +128,9 @@ def arg_to_proto(
"""
msg = v2.program_pb2.Arg() if out is None else out

if isinstance(value, FLOAT_TYPES):
if isinstance(value, bool):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on line 146, there is a check for np.bool_, should that be included in this check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@dstrain115 dstrain115 requested a review from senecameeks March 24, 2025 19:18
@dstrain115 dstrain115 added this pull request to the merge queue Mar 24, 2025
Merged via the queue into quantumlib:main with commit eddb281 Mar 24, 2025
38 checks passed
@dstrain115 dstrain115 deleted the add_boolean_values branch March 24, 2025 23:48
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
* Add boolean support to cirq_google protos

* Add np.bool.

* Fix type issue.
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