-
Notifications
You must be signed in to change notification settings - Fork 11
DevGuide Cells
Cells are grouped into a three-tiered heirarchy:
- category: A collection of packages that are grouped together for display purposes
- package: A collection of related commands.
- command: A specific operation in a cell.
Commands are managed by info.vizierdb.commands.Commands. Call Commands.register()
to register a package and its associated commands (see the bottom of the Commands
implementation for an example).
A specific command is identified by the 2-part identifier: package.command
Each command includes the info.vizierdb.commands.Command trait, and should implement the following methods:
-
name
: The user-facing name of the command -
parameters
: A sequence of info.vizierdb.commands.Parameters that describes the arguments to the command. -
format
: Generate a short string representation of the command that will be displayed in the notebook. -
title
: Generate a shorter string representation of the command that will be displayed in the table of contents. -
process
: Execute the command. -
predictProvenance
: Currently unused. Return None.
format
, title
and process
receive an info.vizierdb.commands.Arguments object that provides access to the values of the parameters specified by parameters
.
process
also receives an info.vizierdb.commands.ExecutionContext that describes the notebook state at the point of the cell. The context can be used to retrieve artifacts, create artifacts, or output messages.