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

Move examples to sphinx-gallery #57

Closed
wants to merge 11 commits into from
Closed

Move examples to sphinx-gallery #57

wants to merge 11 commits into from

Conversation

banesullivan
Copy link
Collaborator

@banesullivan banesullivan commented Jan 11, 2020

These changes moves all of the examples to work with Sphinx Gallery (SG). SG provides a way to show off your examples with really nice formatting and incorporating the examples as test cases to make sure the example in your docs are always in working state when a user tries them out.

Previously, the examples were in two places, in scripts under the examples directory and in code blocks within the documentation pages. Having the examples in two places can lead to discrepancies and maintenance issues, these changes consolidate the examples into a single place (doc and code) and provide a way to test all of the examples.


I would highly recommend that you all switch from readthedocs.org to Travis and GitHub pages for building and deploying your docs. Readthedocs build environment is very limited and you will not be able to showcase any 3D examples with PyVista if you stay on readthedocs. Also, the whole purpose of this is to have your examples all in one place where they can be tested and incorporated into the documentation - Sphinx-gallery will run each example when building the docs and that is a great build status check to incorporate in with GitHub status checks (readthedocs does not support that)

2020-01-11 15 00 59

@banesullivan
Copy link
Collaborator Author

banesullivan commented Jan 11, 2020

In its current state, everything should build on readthedocs fine, but if you want to show add the example in #36, then you'll have to switch to using GitHub pages with a service like doctr

@banesullivan
Copy link
Collaborator Author

Also, it looks like there are a ton of images in the docs/source/pics directory... most of these are now automatically generated by sphinx-gallery during the docs build, so they can be deleted.

@banesullivan banesullivan marked this pull request as ready for review January 11, 2020 22:16
@banesullivan
Copy link
Collaborator Author

It appears the builds are failing because you all upload to PyPI on every build (and I don't have privileges to do that)?

@banesullivan banesullivan changed the base branch from master to develop January 13, 2020 16:15
@banesullivan banesullivan mentioned this pull request Jan 13, 2020
@MuellerSeb MuellerSeb self-assigned this Jan 23, 2020
@MuellerSeb MuellerSeb self-requested a review January 23, 2020 13:06
Copy link
Member

@MuellerSeb MuellerSeb left a comment

Choose a reason for hiding this comment

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

Hey there! Sorry for being a bit late on this, but:

THIS IS AWESOME

Thanks for your effort. I just have a few comments:

  1. There are warnings from Matplotlib given as output in the generated files. We can suppress them with:
import warnings
warnings.filterwarnings(
    "ignore", 
    category=UserWarning,
    message='Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.',
)

See: https://sphinx-gallery.github.io/stable/configuration.html
2. The Herten example takes really long... I don't know if we can somehow speed that up.. but it is working for now, so I am fine with it.
3. I would put the "introduction" at the end and call it "Miscellaneous"
4. tutorial 2 has a strange structuring. I would make some more sub-items
5. I would swap the two sub-items under tutorial 3
6. tutorial 4 could be just one page

Some more comments were made in the review.
I will update the actual examples itself after merging this PR.

Thank you for the effort! You are the contributor of the month :-)

"examples/06_conditioned_fields/",
"examples/07_transformations/",
],
# Patter to search for example files
Copy link
Member

Choose a reason for hiding this comment

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

Typo: "Pattern"

"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "gstools",
#"image_scrapers": ('pyvista', 'matplotlib'),
Copy link
Member

Choose a reason for hiding this comment

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

Why these comments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For when you all start using PyVista for some 3D viz in the example gallery, you will need to add the pyvista image scraper. I figured I would leave this here for when that happens

.. toctree::
:maxdepth: 1
:includehidden:
:maxdepth: 3
Copy link
Member

Choose a reason for hiding this comment

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

Why :maxdepth: 3? We think 1 is enough, as the chapters are very short in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants