Jupyter Notebooks are a versatile and popular instance of the literate programming paradigm. Jupyter allows authors to intersperse code chunks with explanation and annotation, providing readers with more information about the intent and function of programming choices.
You can run Jupyter notebooks in two ways on Code Ocean:
From the top all the way to the bottom via a master script. This is what happens when you click 'Reproducible Run' in your capsule.
Interactively via a Cloud Workstation. This is akin to a more typical Jupyter notebook experience.
Reproducibly Running a Notebook via a Master Script
To publish on Code Ocean, we require that notebooks be executed as a whole, serving as a reproducible record of the analysis from start to finish. This article shows you how.
Running Notebooks Interactively
To work in a Jupyter notebook interactively, see Cloud Workstations.
To install Jupyter:
If you have the Conda or pip installers, add
jupyter
to either.Launching a Jupyter Cloud Workstation will install it automatically.
To install Jupyter manually, add via apt-get:
python3-pip
,python3-setuptools
, andpython3-wheel
, and then via the (newly visible) pip installer, addjupyter
.
Example Capsules Using Jupyter Notebooks
A Modularized Efficient Framework for Non-Markov Time Series Estimation (this capsule uses a bash script to execute many notebooks in parallel)
On Writing Reproducible and Interactive Papers (this capsule demonstrates how to render a Jupyter notebook to
.tex
and subsequently to PDF, which requires LaTeX to be installed
Further Reading
nbconvert GitHub repo (external resource)