-
Notifications
You must be signed in to change notification settings - Fork 217
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
docs/notebook_validation.py: update nbconvert logs #2703
base: main
Are you sure you want to change the base?
Conversation
add the name of the notebook for the timing. This is because in CI, the list of timings is printed after the nbconvert is done, so you see something like: [NbConvertApp] Converting notebook applications/python/readout_error_mitigation.ipynb to notebook [NbConvertApp] Writing 187307 bytes to applications/python/readout_error_mitigation.nbconvert.ipynb [NbConvertApp] Converting notebook applications/python/deutsch_jozsa.ipynb to notebook [NbConvertApp] Writing 10396 bytes to applications/python/deutsch_jozsa.nbconvert.ipynb Time taken for nbconvert: 6.10 seconds Time taken for nbconvert: 7.83 seconds Time taken for nbconvert: 10.72 seconds Time taken for nbconvert: 3.18 seconds Time taken for nbconvert: 7.33 seconds Time taken for nbconvert: 6.19 seconds Which makes it hard to see what took a long time. Signed-off-by: Mitchell Dzurick <[email protected]>
print(f"Time taken for nbconvert: {elapsed:.2f} seconds") | ||
print( | ||
f"Time taken for nbconvert : {elapsed:.2f} seconds for '{notebook_filename}'" | ||
) | ||
os.remove(notebook_filename_out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to remove this _out file in the except block if there is an error while running nbconvert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. I think it won't help much for simply timing out but if an actual error occurs it could be nice to know how long it took to hit the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you mean remove the file itself, my brain for some reason was thinking you were asking for the timing as well for an error, which thinking about it could be helpful too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:). Yes, we can add finally block here (and add os.remove in it) which can clean this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one change unrelated to this PR requested. Thanks @mitchdz.
Let's hold off on merging this in, there's some higher priority PRs in the pipeline for release. |
Improve the timing logs for the docker container validation during nbconvert.
This is because in CI, the list of timings is printed after the nbconvert is done, so you see something like:
See: https://github.com/NVIDIA/cuda-quantum/actions/runs/13690948087/job/38285994246#step:5:1387
Which makes it hard to see what took a long time.