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

Reorganise "Save jobs" page #1203

Merged
merged 6 commits into from
Apr 19, 2024
Merged

Reorganise "Save jobs" page #1203

merged 6 commits into from
Apr 19, 2024

Conversation

frankharkins
Copy link
Member

This page originally submitted a simple job using the cloud simulator as a demonstration. Since the simulators are being deprecated, #1160 removed the job-submitting step and hardcoded the job_id into the notebook. This was a bad idea because it means the notebook breaks if not run with my IBM Quantum account.

This PR reorganises the page to get job_id programatically first. This lets us avoid hardcoding the job_id in the notebook, which means we can run the notebook with any IBM account that has submitted at least one job.

This lets us avoid hardcoding the `job_id`, which means anyone can run
the notebook successfully (rather than just Frank).
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Looks good! Are we confident that CI will always have jobs run in the past day, the next time we go to regenerate this notebook? Would it instead be safer to do something like past 3 days or past week? It won't fail if no jobs were run in the past day, but the output would be empty

@frankharkins
Copy link
Member Author

Are we confident that CI will always have jobs run in the past day...

It think it's likely it might not, but IMO empty output is OK. Open to other suggestions though.

@Eric-Arellano
Copy link
Collaborator

Open to other suggestions though.

You could change it to the past week. Or probably even better: ask for all jobs but use a slice to only show up to 3, jobs[:3]

>>> [1,2,3,4,5][:3]
[1, 2, 3]
>>> [1][:3]
[1]

@frankharkins
Copy link
Member Author

I quite like the datetime example since it's something a user would realistically want to do, and a bit harder to work out on your own. Maybe we could extend the time period to a year but only display three of them?

@frankharkins
Copy link
Member Author

As a compromise, I went with the last 90 days as timedelta doesn't seem to accept years and 3 months should be more than enough if we're running the cron job every two weeks.

docs/run/save-jobs.ipynb Outdated Show resolved Hide resolved
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@frankharkins frankharkins enabled auto-merge April 19, 2024 21:05
@frankharkins frankharkins added this pull request to the merge queue Apr 19, 2024
Merged via the queue into main with commit f480d9c Apr 19, 2024
5 checks passed
@frankharkins frankharkins deleted the FH/save-jobs branch April 19, 2024 21:09
frankharkins added a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
This page originally submitted a simple job using the cloud simulator as
a demonstration. Since the simulators are being deprecated, Qiskit#1160
removed the job-submitting step and hardcoded the `job_id` into the
notebook. This was a bad idea because it means the notebook breaks if
not run with my IBM Quantum account.

This PR reorganises the page to get `job_id` programatically first. This
lets us avoid hardcoding the `job_id` in the notebook, which means we
can run the notebook with any IBM account that has submitted at least
one job.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants