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

Check reservation status for a list of processors #140

Merged
merged 10 commits into from
Feb 11, 2021

Conversation

lingxz
Copy link
Contributor

@lingxz lingxz commented Feb 6, 2021

@lingxz lingxz marked this pull request as ready for review February 8, 2021 19:28
@lingxz lingxz requested a review from dstrain115 February 8, 2021 19:29
Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

for time_slot in processor.get_schedule():
try:
time_slot = EngineTimeSlot.from_proto(time_slot)
# Parsing the end_time of the last time range in the schedule might give throw an error.
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 expected? This seems like a problem. I am not sure we should just ignore ValueError blindly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to be a problem in the EngineTimeSlot.from_proto function in cirq. For example, the end time of the last interval in the schedule has

end_time {                                                                                                                                  
  seconds: 253402300799
}

which raises ValueError: year 0 is out of range when trying to parse it with the datetime library.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I will go and fix this in cirq. Let's add a TODO (and ideally, a github issue) to go back and fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a TODO, and created an issue in cirq: quantumlib/Cirq#3787

@lingxz lingxz force-pushed the reservation-status branch from 32b7e84 to 60e6985 Compare February 9, 2021 11:56
for time_slot in processor.get_schedule():
try:
time_slot = EngineTimeSlot.from_proto(time_slot)
# Parsing the end_time of the last time range in the schedule might give throw an error.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I will go and fix this in cirq. Let's add a TODO (and ideally, a github issue) to go back and fix this.

@lingxz lingxz merged commit 77b1087 into quantumlib:master Feb 11, 2021
weinstein pushed a commit to weinstein/ReCirq that referenced this pull request Feb 16, 2021
* Add reservation status check function

* Check reservation wip

* Add tests for get_available_processors

* Break lines in comments

* Fix tests

* Use the correct processor id and convert QuantumTimeSlot to EngineTimeSlot

* address comments

* Add test for other project id

* Add TODO for time range parsing problem
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