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

WIP: Using a notebook + nbconvert to execute code blocks #422

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

maartenbreddels
Copy link

This is the initial attempt to use a notebook + nbconvert to produce rich output, as explained in #421. It does not yet do any attempt to make a snapshot of the html or widget output.
I understand the issues with the dependency in nbconvert/nbformat, but this is more of an exploration of what is possible. Note that the dependency could be totally optional.

It renders (most) of the gallery already, except for mayavi:
screen shot 2018-10-12 at 16 49 58

I added an pandas dataframe example (rendering html) and ipyvolume (rendering a live widget). It would be interesting to connect the widget to a live mybinder kernel!.

Pandas dataframe / html

screen shot 2018-10-12 at 16 54 57

screen shot 2018-10-12 at 16 55 28

ipyvolume / ipywidgets

screen shot 2018-10-12 at 16 56 49

To use notebook+nbconvert you need to set the configuration option:
'executor': 'notebook', and optionally set the jupyter_kernel to something else then the default value of 'python3'.

For other languages, such as C++, we need some language specific template that are injected into the notebook for the timing and memory usage.

@choldgraf
Copy link
Contributor

hey @maartenbreddels - looks interesting! Do you think you could give an idea for the main "pros" of doing things this way? E.g., since Sphinx-Gallery already has its own "run the notebook and collect results" script, what would the main benefit be here? Simplification of the build process by offloading onto a dependency?

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.

None yet

2 participants