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 specification of job IDs in RemoteResults #718

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Conversation

HGSilveri
Copy link
Collaborator

  • Allows specification of a subset of job IDs in RemoteResults
  • Exposes RemoteResults.batch_id and RemoteResults.job_ids
  • Supports specification of job_ids in PasqalCloud._fetch_result()

These changes should be useful to PRs #701 and #707 .

Copy link
Collaborator

@oliver-gordon oliver-gordon left a comment

Choose a reason for hiding this comment

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

Some basic Q's but looks fine with me.

pulser-core/pulser/backend/remote.py Show resolved Hide resolved
def _fetch_result(self, submission_id: str) -> typing.Sequence[Result]:
def _fetch_result(
self, submission_id: str, job_ids: list[str] | None
) -> typing.Sequence[Result]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a related change but, how have you defined which types are imported via typing.Type or imported at the top? It's just the abstract classes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's basically everything except typing.Sequence so as to not confuse it with pulser.Sequence (I know, it's unfortunate naming but there's no going back now)

for job in batch.ordered_jobs:
sdk_jobs = batch.ordered_jobs
if job_ids is not None:
ind_job_pairs = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to confirm, this is so we can retain the returned order that they came in? if we associate and order by the index?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, whenever job_ids are provided we want to return the results in the same order they were given. This is simultaneously ensuring that's the case and selecting only the relevant subset of jobs

@HGSilveri HGSilveri added this to the v0.20 Release milestone Sep 11, 2024
@HGSilveri HGSilveri merged commit 6c12156 into develop Sep 16, 2024
7 checks passed
@HGSilveri HGSilveri deleted the hs/job-ids branch September 16, 2024 11:43
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