Skip to content

Conversation

@dstrain115
Copy link
Collaborator

  • Adds bytes to the cirq_google Arg proto
  • Adds hooks in arg_func_langs to serialize and deserialize it.

- Adds bytes to the cirq_google Arg proto
- Adds hooks in arg_func_langs to serialize and
deserialize it.
@dstrain115 dstrain115 requested review from a team, verult, vtomole and wcourtney as code owners March 31, 2025 13:28
@codecov
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.14%. Comparing base (c50ce1e) to head (98afc38).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7201      +/-   ##
==========================================
- Coverage   98.14%   98.14%   -0.01%     
==========================================
  Files        1100     1100              
  Lines       96147    96244      +97     
==========================================
+ Hits        94365    94458      +93     
- Misses       1782     1786       +4     

☔ 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 31, 2025 13:47
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Please see comments before merging.

if which_val == 'value_with_unit':
return tunits.Value.from_proto(arg_value.value_with_unit)
if which_val == 'bytes_value':
return bytes(arg_value.bytes_value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note (no change necessary) - perhaps these iffs could be converted to a match-case block.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SGTM, maybe in a follow-up PR.

(1.0, {'arg_value': {'float_value': 1.0}}),
(1, {'arg_value': {'float_value': 1.0}}),
(
bytes('abcdef', 'utf-8'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit - consider replacing bytes('abcdef', 'utf-8') --> b'abcdef'

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 added this pull request to the merge queue Mar 31, 2025
Merged via the queue into quantumlib:main with commit 75f0dd3 Mar 31, 2025
38 checks passed
@dstrain115 dstrain115 deleted the add_bytes_to_proto branch March 31, 2025 23:26
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
* Add bytes to cirq_google proto

- Adds bytes to the cirq_google Arg proto
- Adds hooks in arg_func_langs to serialize and
deserialize it.

* Changed bytes to b
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