Skip to content

Add metadata into single sweep of cirq-google/cirq_google/api/v2/run_context.proto #6869

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 8 commits into from
Jan 6, 2025

Conversation

BichengYing
Copy link
Collaborator

@BichengYing BichengYing commented Dec 20, 2024

The motivation of adding this metadata field (will replace DeviceParameter at least internal usage) is because of the headache during the development of cirq server.

This is mainly to address the following three issues:

  • One sweep may associated with multiple registry parameters (compared with using zip, this is more compact representation)
  • We may want different column name from the symbol name (or reg_parameter).
  • We may or may not want to include the axes value in the returned dataset. (Internally, we use Const or Var to represent it, it is better to be explicitly in the proto instead)

@BichengYing BichengYing requested review from wcourtney, vtomole, verult and a team as code owners December 20, 2024 19:57
@CirqBot CirqBot added the size: M 50< lines changed <250 label Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.86%. Comparing base (83a8e0e) to head (9bcfa14).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6869      +/-   ##
==========================================
- Coverage   97.86%   97.86%   -0.01%     
==========================================
  Files        1084     1084              
  Lines       94290    94290              
==========================================
- Hits        92280    92279       -1     
- Misses       2010     2011       +1     

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

Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. My only concern is about testing the changes. Pardon my ignorance w.r.t. this part of the code, but is there any way to add test cases for this change?

@BichengYing
Copy link
Collaborator Author

This looks reasonable to me. My only concern is about testing the changes. Pardon my ignorance w.r.t. this part of the code, but is there any way to add test cases for this change?

About the test, it will be added after we have functional code calling this protobuf. (The python code generated here are auto-generated).

@mhucka mhucka enabled auto-merge (squash) January 2, 2025 21:32
Copy link
Collaborator

@senecameeks senecameeks left a comment

Choose a reason for hiding this comment

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

LGTM % nits

@mhucka mhucka merged commit b840178 into quantumlib:main Jan 6, 2025
35 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jan 16, 2025
Continue #6869

This PR added a new path to encode and decode metadata to this
corresponding proto. Notice this is a side path if the metadata in sweep
is not encoded as `Metadata` class, the code path is still old and same
for `from_proto` case. If the proto does not contain `metadata` proto
field, the code still convert back as the old style
@mhucka mhucka changed the title Add metadata into single sweep Add metadata into single sweep of cirq-google/cirq_google/api/v2/run_context.proto Apr 8, 2025
BichengYing added a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
BichengYing added a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
Continue quantumlib#6869

This PR added a new path to encode and decode metadata to this
corresponding proto. Notice this is a side path if the metadata in sweep
is not encoded as `Metadata` class, the code path is still old and same
for `from_proto` case. If the proto does not contain `metadata` proto
field, the code still convert back as the old style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants