This extension enables to keep multiple results as tabs in output_area. You can also save/load tabbed outputs as far as this extension is enabled As default behavior the "output_area" under a code cell is cleared and over written in each execution.
- Pin button for saving outputs
- Visualization of each code cell's executing status with colors
- Diff dialog for comparing pinned outputs with current outputs
- Search feature in the diff dialog
To install the multi_outputs extension, the following steps are required.
Install the lc_multi_outputs python package.
pip install git+https://github.com/NII-cloud-operation/Jupyter-multi_outputs
Copy the nbextension files into the jupyter server's search directory.
jupyter nbclassic-extension install --py lc_multi_outputs --user
About details of jupyter nbclassic-extension subcommand, execute this command with --help option, and see the results.
jupyter nbclassic-extension --help
To use the multi_outputs extension, you will also need to enable it.
jupyter nbclassic-extension enable --py lc_multi_outputs --user
- Execute a code cell
- Select the current output (leftmost) tab (if output tabs exist)
- Click the pin button in the output prompt area
The prompt area of code cell displays execution status with colors. The colors mean as follows:
- White: Not Executed
- Light cyan: Awaiting Execution
- Green: Successfully Executed
- Pink: Failed
You can compare pinned output with current output.
- Select the pinned output tab you want to compare with current output
- Click the diff button in the output prompt area
You can search keyword from the outputs compared in the diff dialog. To search, input keyword to the search field and press the Enter key.
The pinned outputs are saved as cell metadata.
This is an example of a code cell
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"pinned_outputs": [
{
"execution_count": 1,
"outputs": [
{
"data": {
"text/plain": "'2017/10/12 13:36:42'"
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
]
}
]
},
"outputs": [
{
"data": {
"text/plain": [
"'2017/10/12 13:36:49'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from datetime import datetime\n",
"datetime.now().strftime('%Y/%m/%d %H:%M:%S')"
]
}
To remove the extension, execute:
pip uninstall lc_multi_outputsNote: You will need NodeJS to build the extension package.
The jlpm command is JupyterLab's pinned version of
yarn that is installed with JupyterLab. You may use
yarn or npm in lieu of jlpm below.
# Clone the repo to your local environment
# Change directory to the lc_multi_outputs directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm buildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter labWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
jupyter lab build --minimize=Falsepip uninstall lc_multi_outputsIn development mode, you will also need to remove the symlink created by jupyter labextension develop
command. To find its location, you can run jupyter labextension list to figure out where the labextensions
folder is located. Then you can remove the symlink named lc_multi_outputs within that folder.
See RELEASE
This project is licensed under the terms of the Modified BSD License (also known as New or Revised or 3-Clause BSD), see LICENSE.txt.

