[IPython-dev] Restart notebook and run all cells button

Nathan Goldbaum nathan12343 at gmail.com
Tue Aug 11 16:14:44 EDT 2015


On Tue, Aug 11, 2015 at 3:05 PM, Wes Turner <wes.turner at gmail.com> wrote:

> * For the commandline (not js) runipy may be helpful:
> https://github.com/paulgb/runipy
>
>
Thanks for the suggestion. I've actually contributed to runipy in the past,
so I'm well aware of it. This isn't for the command line, it's because my
*most common* interaction with the notebook is to iterate on a problem by
restarting the kernel and running all the cells every time I change
something.  This avoids subtle nonlinear dependencies between cells and
satisfies my OCD need to have the cell execution numbers be sequential :)

It looks like Matthias' example is a good starting point. Thanks for the
link Matthias!


> ... from https://westurner.org/tools/#runipy
>
> runipy⬅ <https://westurner.org/tools/#runipy>
> Src: git https://github.com/paulgb/runipy
> PyPI: https://pypi.python.org/pypi/runipy
>
> runipy runs Jupyter notebooks
> <https://westurner.org/tools/#jupyter-notebook> from a Shell
> <https://westurner.org/tools/#shells> commandline, generates HTML reports,
> and can write errors to stderr.
>
> Jupyter notebook <https://westurner.org/tools/#jupyter-notebook> *manual* test
> review process:
>
> # - run Jupyter Notebook server
> !jupyter notebook
> # - Browser
> #     - navigate to / upload / drag and drop the notebook
>         !web http://localhost:8888   # or https://
> #     - (optional) click 'Cell' > 'All Output' > 'Clear'
> #     - click 'Cell' > 'Run All'
> #     - [wait] <Jupyter Kernel runs notebook>
> #     - visually seek for the first ERRoring cell (scroll)
> #     - review the notebook
>         for (i, o) in notebook_cells:
>             human.manually_review((i, o))
> # - Compare the files on disk with the most recent commit (HEAD)
> !git status && git diff
> !git diff mynotebook.ipynb
> # - Commit the changes
> !git-add-commit "TST: mynotebook: tests for #123" ./mynotebook.ipynb
>
> Jupyter notebook <https://westurner.org/tools/#jupyter-notebook> runipy
> review process:
>
> # - runipy the Jupyter notebook
> !runipy mynotebook.ipynb
> # - review stdout and stderr from runipy
> # - review in browser (optional; recommended)
> #     - navigate to the converted HTML
>         !web ./mynotebook.ipynb.html
> #     - visually seek for the first WEEoring cell (scroll)
> #     - review the notebook
>         for (i, o) in notebook_cells:
>             human.manually_review((i, o))
> # - Compare the files on disk with the most recent commit (HEAD)
> !git status && git diff
> !git diff mynotebook.ipynb*
> # - Commit the changes
> !git-add-commit "TST: mynotebook: tests for #123" ./mynotebook.ipynb*
>
>
>    - An example of runipy usage in a Makefile
>    <https://westurner.org/tools/#make>:
>    https://github.com/westurner/notebooks/blob/gh-pages/Makefile
>
>
> On Tue, Aug 11, 2015 at 1:38 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>> Hi all,
>>
>> Has anyone put together a notebook extension that combines the "restart
>> kernel" and "run all cells" menu options into a single button or keyboard
>> shortcut? If so, can you point me to the appropriate repo?
>>
>> Thanks for your help!
>>
>> -Nathan
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150811/ab5bfc2c/attachment.html>


More information about the IPython-dev mailing list