notebook
Auto-generated from jupyter/notebook by Mutable.ai Auto WikiRevise
notebook | |
---|---|
GitHub Repository | |
Developer | jupyter |
Written in | Jupyter Notebook |
Stars | 11k |
Watchers | 323 |
Created | 04/09/2015 |
Last updated | 04/05/2024 |
License | BSD 3-Clause "New" or "Revised" |
Homepage | jupyter-notebook.readthedocs.io |
Repository | jupyter/notebook |
Auto Wiki | |
Revision | |
Software Version | 0.0.8Basic |
Generated from | Commit 3b8e67 |
Generated at | 04/05/2024 |
The Jupyter Notebook repository is a comprehensive solution for creating and managing interactive notebooks, which are documents that combine live code, visualizations, and rich text. This repository contains the core functionality and implementation of the Jupyter Notebook application, providing a powerful and extensible platform for data analysis, scientific computing, and interactive documentation.
The most important components of this repository are:
-
Application Initialization and Configuration: The
app
directory contains the main entry point (index.template.js
) and Webpack configuration files (webpack.config.js
,webpack.config.watch.js
) that set up the build process for the Jupyter Notebook frontend, handling extensions, mime-types, and module federation. -
Core Functionality: The
packages
directory houses the core functionality and extensions that power the Jupyter Notebook application. This includes theNotebookApp
class (…/app.ts
), which is responsible for initializing the application, handling events, and registering plugins. TheNotebookShell
class (…/shell.ts
) manages the layout and organization of the various components in the Jupyter Notebook user interface. -
Documentation: The
docs
directory provides comprehensive documentation for the Jupyter Notebook, covering topics such as Configuration, Extension Development, Migration to Notebook 7, and user-facing features. -
Notebook Server: The
notebook
directory contains the core functionality of the Jupyter Notebook server, including the main entry point (__main__.py
) and various request handler classes (app.py
) that define the functionality for rendering the different pages of the Jupyter Notebook web application. -
UI Testing: The
ui-tests
directory contains a comprehensive suite of Playwright-based UI tests that cover a wide range of functionality, such as editing and renaming notebook files, interacting with the file browser, and verifying the layout and appearance of the Jupyter Notebook interface.
The Jupyter Notebook repository is built on top of the Lumino framework, which provides a modular and extensible architecture for building rich web applications. The NotebookApp
class and the NotebookShell
class are the key components that manage the application's lifecycle and layout, respectively. The repository also makes use of the traitlets
library, which provides a flexible configuration system for managing the various settings and options available in the Jupyter Notebook application.
The Jupyter Notebook repository is designed to be highly extensible, allowing developers to create custom plugins and extensions that enhance the functionality of the application. This is achieved through the use of the INotebookPathOpener
interface (…/tokens.ts
), which allows other extensions or downstream applications to customize the way a notebook is opened.
Application Initialization and ConfigurationRevise
References: app
The app
directory contains the main entry point and configuration files for the Jupyter Notebook application. The key functionality includes:
Application Entry PointRevise
References: app/index.template.js
The index.template.js
file is the main entry point for the Jupyter Notebook application. It is responsible for loading and initializing the various components and plugins that make up the Notebook application.
Webpack ConfigurationRevise
References: app/webpack.config.js
, app/webpack.config.watch.js
The Webpack configuration files set up the build process for the Jupyter Notebook frontend, handling extensions, mime-types, and module federation.
Public Path ManagementRevise
References: app/publicpath.js
The publicpath.js
file in the app
directory is responsible for dynamically setting the Webpack public path based on the configuration settings of the Jupyter Notebook application. This is a critical step to ensure the correct public path is used, particularly in supporting the classic Notebook's different public path setup.
Core FunctionalityRevise
References: packages
The core functionality of the Jupyter Notebook application is defined in the packages
directory. This directory contains the following key components:
Application FunctionalityRevise
The core functionality of the Jupyter Notebook application is managed by the NotebookApp
class, defined in the …/app.ts
file. This class is responsible for initializing the application, setting up the document registry, registering mime renderer plugins, and populating application information.
Notebook Tree FunctionalityRevise
References: packages/tree/src
, packages/tree/style
The "tree" package in the Jupyter Notebook application provides core functionality related to the notebook tree structure and the tokens or identifiers used within the notebook tree.
Notebook Extension FunctionalityRevise
References: packages/notebook-extension/src
The …/src
directory contains various plugins and components that extend the functionality of the Jupyter Notebook application. These plugins add features such as checkpoint management, kernel status display, output scrolling, and notebook metadata editing to the Jupyter Notebook user interface.
Terminal Extension FunctionalityRevise
References: packages/terminal-extension/src
The terminal extension for the Jupyter Notebook application provides the functionality to open terminals in a new tab, allowing users to work with terminals without disrupting the main application area.
Lab Extension FunctionalityRevise
References: packages/lab-extension/src
The Jupyter Lab extension in the …/src
directory provides functionality for switching between different Jupyter interfaces (Notebook, Lab, and Classic Notebook).
Help Extension FunctionalityRevise
References: packages/help-extension/src
The Help Extension Functionality section covers the implementation of the help extension for the Jupyter Notebook application, including commands to open external URLs and display an "About Jupyter Notebook" dialog.
Document Search Extension FunctionalityRevise
References: packages/documentsearch-extension/src
The notebookShellWidgetListener
plugin in the …/index.ts
file is responsible for managing the searchability of the active widget in the Jupyter Notebook application's notebook shell.
Console Extension FunctionalityRevise
References: packages/console-extension/src
The Console Extension Functionality in the Jupyter Notebook application is responsible for handling the functionality of opening consoles in a new tab. This is implemented through two plugins:
Tree Extension FunctionalityRevise
References: packages/tree-extension/src
The tree-extension
package in the Jupyter Notebook application provides several plugins that enhance the functionality of the file browser and notebook tree view. These plugins focus on improving the user experience for managing files and running sessions within the notebook environment.
DocumentationRevise
References: docs
The documentation for the Jupyter Notebook application covers a wide range of topics, including configuration, extension development, migration, and user-facing features.
ConfigurationRevise
References: docs/source/configuring
The Jupyter Notebook application provides a wide range of configuration options that allow users to customize its behavior and interface. These configuration options are managed through Jupyter's common configuration system, which is shared across Jupyter applications.
Extension DevelopmentRevise
References: docs/source/extending
The Jupyter Notebook application provides a flexible extension system that allows developers to enhance its functionality. This subsection discusses how to extend the Jupyter Notebook, focusing on developing frontend extensions and integrating with the Jupyter Server.
Migration to Notebook 7Revise
References: docs/source/migrating
The migration to Jupyter Notebook 7 involves several key changes, including updates to custom themes, frontend extensions, server extensions, and the use of multiple interfaces.
User DocumentationRevise
References: docs/source
The user-facing documentation for the Jupyter Notebook covers the Notebook user interface, available features, and troubleshooting common issues.
Notebook ServerRevise
References: notebook
The Jupyter Notebook server is the core component that powers the Jupyter Notebook application. It is responsible for initializing and configuring the server application, as well as handling the various request handlers that define the functionality for rendering the different pages of the Jupyter Notebook web application.
Main Entry PointRevise
References: notebook/__main__.py
The main()
function in …/__main__.py
is the entry point for the Jupyter Notebook server application. This function is responsible for initializing and configuring the server application.
Request HandlersRevise
References: notebook/app.py
The various request handler classes in the app.py
file define the functionality for rendering the different pages of the Jupyter Notebook web application. These handler classes are responsible for handling the HTTP requests and generating the appropriate responses for the various pages of the Jupyter Notebook interface.
TemplatesRevise
References: notebook/templates
The Jinja2 templates used to render the HTML pages for the Jupyter Notebook application are located in the …/templates
directory. These templates handle the initial setup and configuration of the pages, including loading the necessary JavaScript code and handling page-specific functionality.
Custom CSSRevise
References: notebook/custom/custom.css
The custom.css
file is a placeholder for custom user CSS styles in the Jupyter Notebook application. This file is intended to be overridden by users in their profile's static/custom/custom.css
file.
Version InformationRevise
References: notebook/_version.py
The _version.py
file in the notebook
directory defines the current version of the Jupyter Notebook application. It provides a standardized way to represent and work with the version number, which is important for managing releases and ensuring compatibility across different versions of the software.
Server Extension IntegrationRevise
References: notebook/__init__.py
The notebook/__init__.py
file defines the integration of the Jupyter Notebook application with the Jupyter Server and Jupyter Lab extensions. It provides the following key functionality:
UI TestingRevise
References: ui-tests
The Jupyter Notebook application includes a comprehensive suite of Playwright-based UI tests, which are located in the …/test
directory. These tests cover a wide range of functionality, ensuring the stability and reliability of the Jupyter Notebook interface.
Playwright-based UI TestsRevise
References: ui-tests/test
The comprehensive suite of Playwright-based UI tests for the Jupyter Notebook application is located in the …/test
directory. These tests cover various aspects of the Jupyter Notebook's functionality, including:
Editor TestsRevise
References: ui-tests/test/editor.spec.ts
The editor.spec.ts
file in the …/test
directory contains tests that verify the editor functionality in the Jupyter Notebook application, specifically the ability to rename files.
File Browser TestsRevise
References: ui-tests/test/filebrowser.spec.ts
The filebrowser.spec.ts
file contains a suite of UI tests that verify the functionality of the file browser in the Jupyter Notebook application. These tests cover key scenarios related to selecting files and folders, opening files, and navigating the directory structure.
General Notebook TestsRevise
References: ui-tests/test/general.spec.ts
The general.spec.ts
file contains a test case that verifies the rendering of a Jupyter Notebook, including the kernel status, checkpoint indicator, and notebook footer.
Layout TestsRevise
References: ui-tests/test/layout.spec.ts
The layout.spec.ts
file in the …/test
directory contains a Playwright test suite that verifies the layout customization functionality of the Jupyter Notebook application. Specifically, it tests that the Debugger panel is displayed in the left sidebar area as per the configured settings.
Link TestsRevise
References: ui-tests/test/links.spec.ts
The Link Tests section discusses the tests for verifying the functionality of local links in a Jupyter Notebook, including opening the current directory and folders.
Mobile TestsRevise
References: ui-tests/test/mobile.spec.ts
The mobile.spec.ts
file in the …/test
directory contains two test cases that verify the layout and appearance of the Jupyter Notebook interface on a mobile device.
Notebook TestsRevise
References: ui-tests/test/notebook.spec.ts
The Notebook Tests section covers the suite of UI tests for the Jupyter Notebook application, including verifying the notebook title, renaming the notebook, and testing the automatic scrolling of notebook outputs.
Settings TestsRevise
References: ui-tests/test/settings.spec.ts
The settings.spec.ts
file contains a Playwright test suite that verifies the persistence of the "Show Header" setting in the Jupyter Notebook application.
Smoke TestsRevise
References: ui-tests/test/smoke.spec.ts
The "Smoke Tests" section covers the "tour" tests that ensure the overall functionality of the Jupyter Notebook application, including opening the JupyterLab interface.