Closed cosenal closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.22%. Comparing base (
2a41ad0
) to head (7ea42ff
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Nice! Thanks for implementing this. One thing I noticed is that it doesn't include the images referenced in the notebook, so for the example you link:
For a demo, see https://mitiq--2363.org.readthedocs.build/en/2363/examples/calibration-tutorial.html
The image at the top doesn't load. In this case it's no big deal since the image is basically just a thumbnail
However, in cases where there's a diagram or figure included, it might be confusing to not have it missing.
Looking through a handful of examples though, e.g. (layerwise folding, Pennylane, it seems like the vast majority of images that are included in these docs are generated by the code itself, e.g.
from the PennyLane example, so I don't see this as a blocking issue.
@jordandsullivan I don't see any great solution for that. And in fact it's going to be the same in any implementation of the «Download notebook» if we want to export it as an .ipynb. Unless we overcomplicate it and package it as a zip with images included. Same problem with all implementations I saw around, for example see the notebook that you can download from Jupyter Book chapter: https://inferentialthinking.com/chapters/08/Functions_and_Tables.html
A solution could be to use absolute url for images, which are already in our repo. E.g. https://github.com/unitaryfund/mitiq/blob/main/docs/source/_thumbnails/calibration.png
for your example.
@cosenal Yeah like I said, I think it's fine given that it seems relatively rare the images contain anything crucial in our notebooks.
Not to complicate things, but if we want to keep the images, we can always embed them as data directly in an <img>
tag. I had to do it in a personal project before to keep images in Jupyter notebooks. We would just need to also document the need to do so when adding notebooks.
@andre-a-alves that's an option too, but it will make the .md files more bulky and worse to review/edit.
Fixes #1619.
For a demo, see https://mitiq--2363.org.readthedocs.build/en/2363/examples/calibration-tutorial.html