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

Allow external users to use snapshot_id #6739

Merged
merged 17 commits into from
Oct 14, 2024

Conversation

senecameeks
Copy link
Collaborator

@senecameeks senecameeks commented Sep 20, 2024

A follow up to PR, CL

Allows external users to set a snapshot_id

@senecameeks senecameeks marked this pull request as ready for review October 3, 2024 22:59
@senecameeks senecameeks requested review from wcourtney, vtomole, verult and a team as code owners October 3, 2024 22:59
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.83%. Comparing base (5718365) to head (4091e70).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6739   +/-   ##
=======================================
  Coverage   97.83%   97.83%           
=======================================
  Files        1077     1077           
  Lines       92672    92742   +70     
=======================================
+ Hits        90669    90738   +69     
- Misses       2003     2004    +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.

SGTM. However, I don't think I'm at the point yet in my understanding of Cirq and the internal systems that I'm qualified to review this, so I think this needs someone else's approval.

@@ -600,7 +650,7 @@ def test_create_job_with_run_name_and_device_config_name(
priority=10,
processor_selector=quantum.SchedulingConfig.ProcessorSelector(
processor='projects/proj/processors/processor0',
device_config_selector=quantum.DeviceConfigSelector(),
device_config_selector=quantum.DeviceConfigSelector(run_name=""),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change needed? I wouldn't expect this PR's change to affect the existing tests of run_name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a side-effect of moving run_name into a oneof

"Oneof Impact: When you assign an empty string to a string field within a oneof, protocol buffers interpret this as explicitly setting that field to a value (even if it's an empty value). This triggers the oneof to recognize that field as the active one."

@senecameeks senecameeks requested a review from wcourtney October 10, 2024 15:51
Copy link
Collaborator

@BichengYing BichengYing left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +154 to +156
snapshot_id: A unique identifier for an immutable snapshot reference.
A snapshot contains a collection of device configurations for the
processor. Both `snapshot_id` and `run_name` should not be set.
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this above the device_config_name. This should be next to the run name. Also, I feel it is good to put "Both snapshot_id and run_name should not be set." in run_name docstring as well

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.

@senecameeks senecameeks enabled auto-merge (squash) October 10, 2024 19:14
@senecameeks senecameeks disabled auto-merge October 10, 2024 19:31
@CirqBot CirqBot added the size: L 250< lines changed <1000 label Oct 12, 2024
Copy link
Collaborator

@wcourtney wcourtney left a comment

Choose a reason for hiding this comment

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

LGTM % a nit.

@senecameeks senecameeks enabled auto-merge (squash) October 14, 2024 20:39
@senecameeks senecameeks merged commit 54f9e8c into quantumlib:main Oct 14, 2024
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants