xiaoruiyliu/testing_for_computational_notebooks
A Jupyter notebook for extension for testing within notebooks
Testing for computational notebooks
An extension for Jupyter Notebooks that supports a novel testing interaction in computational notebooks.
Source attribution
This system was created using the Cursor IDE, which has an embedded AI-backed programming tool that I used. To get familiar with creating a custom Jupyter Notebook extension, I referenced this resource by Aneesha Bakharia.
Running a Custom Jupyter Notebook Extension
Apologies to the unlucky grader in advance, but running a custom extension will require some set-up. Feel free to email me at xrl@seas.upenn.edu so I can show the extension on my system if you run into any issues. This installation guide is based on the resource linked above.
1) Create a new conda virtual environment
$ conda create --name jupyterexperiments python=3.11
$ conda activate jupyterexperiments
$ conda install -c conda-forge jupyter_contrib_nbextensions
2) Find the extensions directory
$ pip show jupyter_contrib_nbextensions
This shows you where the package is installed. Look for the Location: line in the output.
Navigate to the nbextensions folder and clone this repository. Your final file structure should resemble the following.
# Your File Structure Should Look Like This:
/Users/username/anaconda3/envs/jupyterexperiments/lib/python3.11/site-packages/
└── jupyter_contrib_nbextensions/
└── nbextensions/ ← CLONE THIS REPOSITORY HERE
└── testing_for_computational_notebooks/
└── main.js
└── ...
3) Install and enable the extension
Stay in the nbextensions folder. Then, run the following:
$ jupyter nbextension install testing_for_computational_notebooks --user
$ jupyter nbextension enable testing_for_computational_notebooks/main
4) Open a notebook
Finally, open a notebook. This can be done through a locally hosted notebook by clicking the "New --> Python 3 (ipykernel)" widget after running the command below.
$ jupyter notebook
You should see the widgets that enable the modifications present in the submitted video. The functionalities are in accordance with the Technical Requirements list here.