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
Make template gallery #499
Conversation
Codecov Report
@@ Coverage Diff @@
## master #499 +/- ##
==========================================
+ Coverage 98.89% 99.01% +0.12%
==========================================
Files 74 71 -3
Lines 4695 4561 -134
==========================================
- Hits 4643 4516 -127
+ Misses 52 45 -7
Continue to review full report at Codecov.
|
… into make_template_gallery
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.
This is really beautiful, I love it!
Note, when I build the docs, I get the following errors:
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/amplitude.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/angle.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/basis.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/displacement.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/qaoa.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/embeddings/squeezing.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/layers/cvqnn.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/layers/random.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/layers/strongly_entangling.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/state_preparations/basis.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/state_preparations/mottonen.png
/home/josh/Dropbox/Work/Xanadu/pennylane/doc/introduction/templates.rst:: WARNING: image file not readable: ../_static/templates/subroutines/interferometer.png
An issue with the path? Note that if you instead do /_static
, sphinx treats this as an absolute path starting from the doc folder (avoiding relative path headaches).
However, I notice now that I can't see these 'failed' images anywhere, everything seems to be working...
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.
From my side it looks really amazing @mariaschuld ! :) Once the other comments are also addressed, I have no further objections. This makes the template library really attractive for users browsing the site
I tried for hours and cannot figure out why sphinx is behaving this way. Other options for the path are also not working. Maybe related to this: sphinx-gallery/sphinx-gallery#120 ? |
I'll try and look into it today! |
Runs without errors now, I used some code that was commented out in the walrus - I think sphinx takes images and saves them again in a reshaped/thumb version, which is the one it wants to import. |
From my side the only item on my wishlist is to make the images in the gallery items larger. I managed to rescale the cards themselves to be wider, but I cannot enlarge the image.
I think it would be great if they fill the entire upper part, as in normal bootstrap cards: |
Awesome! Couple of quick questions:
I also like the new AmplitudeEmbedding diagram |
Scaling works ok, the cards move into double and then single columns. The is a glitch though, it doesn't fill up the last row nicely: Single column works well As for the size, I can't see a difference between cards. Which one did you spot? Should be regulated by the picture size, which should be the same by design. |
The three layers seem very subtly different heights (e.g., the baseline of StrongEnt seems to be below that of RandomLayers). A height difference could also explain that missing hole when resizing the template cards |
You were right @josh146. With the height and width of the image fixed the resizing problem disappears. And this is the normal view: |
… into make_template_gallery
<a href={link}> | ||
<img class="card-img-top" src={thumbnail} alt="image not found"> | ||
<img class="card-img-top" src={thumbnail} alt="image not found" style="width: 13rem; height: 6rem;"> |
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.
👍
Context:
The templates.rst file was outdated and needed the latest templates to be added. In the process I turned tables into a gallery, which is much more appealing.
Description of the Change:
Add custom directives for gallery items and turn tables into gallery.
Results only affect this tab:
Here is a sneak peak:
Benefits: User gets an idea of what the templates are on first glance.
Possible Drawbacks: We should make the gallery thumbnails wider to have less white space?
Related GitHub Issues: -