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 for Hilbert availability before submitting #845

Closed
wants to merge 3 commits into from

Conversation

vtomole
Copy link
Member

@vtomole vtomole commented Nov 17, 2023

This has been pulled from #827 except it assigns me and doesn't separate the test. Going to try this out before merging the other PR.

Comment on lines +306 to +309
@pytest.mark.skipif(
"cq_hilbert_qpu" not in css.Service().get_targets()["compile-and-run"],
reason="Can't be executed when Hilbert is set to not accept jobs",
)
Copy link
Contributor

@bharat-thotakura bharat-thotakura Nov 17, 2023

Choose a reason for hiding this comment

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

Post v0.5.0, (see #788 and https://github.com/Infleqtion/server-superstaq/pull/2822) get_targets() no longer returns a dictionary and hence doesn't have a ["compile-and-run"] anymore. You would have to do something like:

cq_target = gss.typing.Target(
        target="cq_hilbert_qpu",
        supports_submit=False,
        supports_submit_qubo=False,
        supports_compile=True,
        available=True,
        retired=False,
    )
cq_target not in css.Service().get_targets()

or maybe:

non_submit_targets = [Target.target for Target in css.Service().get_targets(supports_submit=False)]
"cq_hilbert_qpu" in non_submit_targets

This also assumes that the supports_submit flag will automatically be set to False when "cq_hilbert_qpu" is not available which would require server-side changes

@pytest.mark.skip(reason="Can't be executed when Hilbert is set to not accept jobs")
@pytest.mark.skipif(
"cq_hilbert_qpu"
not in qss.SuperstaqProvider()._client.get_targets()["superstaq_targets"]["compile-and-run"],
Copy link
Contributor

Choose a reason for hiding this comment

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

See previous comment. Also, I think you should be able to call get_targets() directly from qss.SuperstaqProvider() since it inherits from gss.service.Service() which contains a get_targets() wrapper.

@vtomole vtomole closed this Nov 30, 2023
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