-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Sphinx gallery for example gallery #2078
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
Conversation
Modified comments in some gallery examples for compatibility with sphinx-gallery parsing. Also modified some links in the narrative doc since image file names have changed.
I had to make a slightly modification in one of sphinx-gallery's files to make it work with scikit-image. I opened a pull request on sphinx-gallery github, hopefully we can delete the local copy after their next release.
ddfe6b2 to
2ddf2ef
Compare
|
I haven't been able to use yet all the cool features of sphinx-gallery. One of them is the possibility to link automatically to examples in the API reference, see http://sphinx-gallery.readthedocs.io/en/latest/advanced_configuration.html#references-to-examples All projects using this feature of sphinx-gallery (such as nilearn, mne-python) seem to rely on templates for the generation of their API. In scikit-image, we use |
|
@scikit-image/core I know that this PR is breaking Travis, but I would still welcome comments, in particular about the API generation (see my previous comment). Thanks! |
|
Regarding Travis' cause of failure, I've opened an issue (sphinx-gallery/sphinx-gallery#120) on Any idea about this weird error? |
|
This is a great step forward, thanks Emmanuelle! Can you explain what you On Wed, 18 May 2016 at 22:41 Emmanuelle Gouillart [email protected]
|
|
Yeah, I'm super excited about it :-). Having the little pop-up when hovering over thumbnails, or links to the API in the examples, is really cool. I just have to solve this sphinx warning/error now :-/. About templates, what I meant is that (from what I understand), the content of API is generated by On the other hand, other packages (sphinx-gallery, nilearn) use templates as in https://raw.githubusercontent.com/nilearn/nilearn/master/doc/templates/function.rst |
|
Travis is happy now, so I would be happy to get reviews :-). |
| ###################################################################### | ||
| # We can use these functions as we would normally use them, but now they work | ||
| # with both gray-scale and color images. Let's plot the results with a color | ||
| # image: |
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.
@emmanuelle sorry, I haven't been following this PR, but is this format change necessary? I think it's way uglier to read!
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.
@jni it is necessary indeed (strings within triple quotes are not transformed to text blocks but appear in the code). The rationale between this is that it's better to teach users to put comments with # than within triple quotes (see the discussion in sphinx-gallery/sphinx-gallery#120), since triple quotes should be docstrings.
But it's a bit ugly to read indeed, and it was a pain to implement :-).
| """ | ||
| ###################################################################### | ||
| #As you can see, the 10-pixel wide black square is highlighted since |
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.
Also here and below :).
|
@sciunto of course, sorry. Worth trying to run your scanner on 0.11 then ( IMO :) ). @emmanuelle sorry for attacking your patience 😃. I've added just a couple of concluding remarks. |
|
@soupault no worries, thank you for the additional review. I removed the commented lines. About the missing spaces, it's some sphinx / sphinx-gallery magic: the layout is broken if I add the spaces. Maybe someone else can figure out if this can be improved. At the moment I'm in the middle of a 24/7 synchrotron campaign, so catching up with PRs is not easy. I let you guys decide if it can be merged as such. |
|
@emmanuelle this builds and works fine for me https://gist.github.com/soupault/170e3065384431ae438e3793ac185fc2 . You have whitespaces after |
|
If you can improve this, it's perfect, but I have no time to fix it in the next few days (experiments running 24/7). Could you please submit a pull request to my branch, or if the PR can be merged with this minor style problem, file a separate PR later on? Thanks! |
|
@emmanuelle I understood. Examples will need an extra review anyways, for me it is a no blocker. I think the PR is finalized in it's essential part. As we have 👍 from @sciunto and several new PRs are starting to depend on this, I'm going for a merge. @emmanuelle thank you a lot for this awesome work, and sorry again for any offense made! 🍷 |
|
@emmanuelle could you squash the commits, please? It is not possible to do this via GitHub interface ('Not enabled for this repository' 😕 ) |
Removed a clumsy workaround (about paths) Fixed links to image files to fix sphinx warning. Removed non-ascii character Another non ascii character And another non-ascii character... (to be squashed later on) Corrected some typos in the docstrings of sphinx-gallery files These corrections have also been submitted as a patch to the original sphinx-gallery project (scikit-image#121) Corrected the appearance of two examples of the gallery Tweaked CSS for larger images Added sphinx-gallery's license and a README.txt about the origin of this directory. Edited gabor_from_astronaut example for nicer popup PEP 8 + minor fixes Removed commented lines of code
1fa80b2 to
8b2dbd5
Compare
|
@soupault I squashed most commits together, I only left the most important ones at the beginning because it may be important to keep a bit of granularity for an important move. |
|
@emmanuelle Build fails on OS X. |
|
It's a latex problem |
|
This is passing now. 😨 |
|
Thank you !!! |
|
This was a massive amount of work; thank you so much @emmanuelle and @soupault for diligent reviewing. |
|
Quick question: is this kind of output expected? |
|
Yes, this output comes from sphinx_gallery. It can be useful to detect examples that take a lot of time to build. If you think that this is too verbose, we could submit a PR to sphinx_gallery so that this output can be optional only. |
|
@soupault do you mean that building the doc (make html) is failing for you on OS X? |
|
@emmanuelle no, not for me. There were some issues with our OS X Travis build (actually, I think that was Travis bug). See #2078 (comment) for the error message. |
This PR ports our gallery examples to sphinx-gallery (http://sphinx-gallery.readthedocs.io/en/latest/).
This PR addresses #1973.
Several modifications were required to use sphinx-gallery, such as
I also had to include the source code of sphinx-gallery, since I needed to do a slight modification to one of these files. I opened a PR on sphinx-gallery (sphinx-gallery/sphinx-gallery#119), if it gets merged in their next release we'll remove our local copy.