Skip to content

Jupyter Notebook Extension: Testing for Changes of Cell Output

License

Notifications You must be signed in to change notification settings

dkrenn/jupyter-nbcelltesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jupyter-nbcelltesting

An extension for testing whether the output of a cell in a Jupyter notebook has changed (meaning if it is different from a previously saved desired output).

Installation

Jumpstart

 $ sudo apt-get install npm
 $ git clone https://github.com/dkrenn/jupyter-nbcelltesting.git
 $ cd jupyter-nbcelltesting
 $ npm install
 $ PYFLAG=--user npm run install-nbcelltesting

From this repository

After cloning this repository, the required JavaScript dependencies have to be installed with the help of npm:

 $ npm install

Afterwards, the extension has to be installed an enabled for your jupyter-notebook. To do so, you have two options:

  1. Automatically via our install-nbcelltesting script for npm by calling
 $ npm run install-nbcelltesting

Note that when following this approach, you can configure the level to which the extension should be installed with the environment variable $PYFLAG, which can be set to

  • --user to install into the user's home Jupyter directories
  • --system to install into the system-wide Jupyter directories
  • --sys-prefix to install into Python's sys.prefix (useful e.g. for virtualenvs)
  • --symlink to symlink this extension instead of copying the files
  • --debug for more-verbose output

The npm script passes $PYFLAG then to the calls to jupyter-nbextension install and jupyter-nbextension enable, as explained below. For example,

 $ PYFLAG=--user npm run install-nbcelltesting

installs the extension into the user's home Jupyter directory.

  1. Manually via jupyter-nbextension install / enable. You have to install and then enable the extension via
     $ jupyter-nbextension install path/to/nbcelltesting/
     $ jupyter-nbextension enable nbcelltesting/main
     $ jupyter-nbextension enable nbcelltesting/resources/diff.min
    
    See the Jupyter notebook documentation for more information.

Using the extension

After successfully installing the extension, fire up the notebook server (jupyter-notebook), open a file and select Cell Testing from the CellToolbar dropdown menu (View > Cell Toolbar > Cell Testing).

Congratulations, you are now using the celltesting-extension!

About

Jupyter Notebook Extension: Testing for Changes of Cell Output

Resources

License

Stars

Watchers

Forks

Packages

No packages published