kernel

package
v0.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2018 License: NCSA Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSessionManager *sessionManager
)

Functions

func NewSession added in v0.2.11

func NewSession(name string) (*session, error)

func NewSessionManager added in v0.2.11

func NewSessionManager() *sessionManager

Types

type ConnectReply

type ConnectReply struct {
	ShellPort int `json:"shell_port"`
	IOPubPort int `json:"iopub_port"`
	StdinPort int `json:"stdin_port"`
	HBPort    int `json:"hb_port"`
}

ConnectReply encodes the ports necessary for connecting to the kernel

type ErrMsg

type ErrMsg struct {
	EName     string   `json:"ename"`
	EValue    string   `json:"evalue"`
	Traceback []string `json:"traceback"`
}

ErrMsg encodes the traceback of errors output to the notebook

type HandlerFunction

type HandlerFunction func(message.Receipt) error

type Kernel

type Kernel struct {
	ExecCounter int
	// contains filtered or unexported fields
}

func New

func New(id string, connectionConfig io.Reader) (*Kernel, error)

func (*Kernel) HandleCommClose added in v0.2.11

func (k *Kernel) HandleCommClose(receipt message.Receipt) error

func (*Kernel) HandleCommInfoRequest added in v0.2.11

func (k *Kernel) HandleCommInfoRequest(receipt message.Receipt) error

func (*Kernel) HandleCommMessage added in v0.2.11

func (k *Kernel) HandleCommMessage(receipt message.Receipt) error

func (*Kernel) HandleCommOpen added in v0.2.11

func (k *Kernel) HandleCommOpen(receipt message.Receipt) error

func (*Kernel) HandleConnectRequest

func (k *Kernel) HandleConnectRequest(receipt message.Receipt) error

func (*Kernel) HandleExecuteRequest

func (k *Kernel) HandleExecuteRequest(receipt message.Receipt) error

HandleExecuteRequest runs code from an execute_request method, and sends the various reply messages.

func (*Kernel) HandleKernelInfoRequest

func (k *Kernel) HandleKernelInfoRequest(receipt message.Receipt) error

SendKernelInfo sends a kernel_info_reply message.

func (*Kernel) HandleShellMsg

func (k *Kernel) HandleShellMsg(receipt message.Receipt) error

HandleShellMsg responds to a message on the shell ROUTER socket.

func (*Kernel) HandleShutdownRequest

func (k *Kernel) HandleShutdownRequest(receipt message.Receipt) error

HandleShutdownRequest sends a "shutdown" message

func (*Kernel) HandleWithStatus

func (k *Kernel) HandleWithStatus(receipt message.Receipt, handler HandlerFunction) error

func (*Kernel) Run

func (k *Kernel) Run() error

func (*Kernel) Shutdown

func (k *Kernel) Shutdown() error

func (*Kernel) Start

func (k *Kernel) Start() error

func (*Kernel) Stop

func (k *Kernel) Stop() error

func (*Kernel) Wait

func (k *Kernel) Wait() error

type KernelInfo

type KernelInfo struct {
	// Version of messaging protocol.
	// The first integer indicates major version.  It is incremented when
	// there is any backward incompatible change.
	// The second integer indicates minor version.  It is incremented when
	// there is any backward compatible change.
	ProtocolVersion string `json:"protocol_version"`
	// The kernel implementation name
	// (e.g. 'ipython' for the IPython kernel)
	Implementation string `json:"implementation"`
	// Implementation version number.
	// The version number of the kernel's implementation
	//(e.g. IPython.__version__ for the IPython kernel)
	ImplementationVersion string `json:"implementation_version"`
	// Information about the language of code for the kernel
	LanguageInfo KernelLanguageInfo `json:"language_info"`
	// A banner of information about the kernel,
	// which may be desplayed in console environments.
	Banner string `json:"banner"`
}

KernelInfo holds information about the igo kernel, for kernel_info_reply messages.

type KernelLanguageInfo

type KernelLanguageInfo struct {
	// Name of the programming language that the kernel implements.
	// Kernel included in IPython returns 'python'.
	Name string `json:"name"`
	// Language version number.
	// It is Python version number (e.g., '2.7.3') for the kernel
	// included in IPython.
	Version string `json:"version"`
	// mimetype for script files in this language
	Mimetype string `json:"mimetype"`
	// Extension including the dot, e.g. '.py'
	FileExtension string `json:"file_extension"`
	//Pygments lexer, for highlighting
	// Only needed if it differs from the 'name' field.
	PpygmentsLexer string `json:"pygments_lexer,omitempty"`
	// Codemirror mode, for for highlighting in the notebook.
	// Only needed if it differs from the 'name' field.
	CodeMirrorMode string `json:"codemirror_mode,omitempty"`
}

type KernelStatus

type KernelStatus struct {
	ExecutionState string `json:"execution_state"`
}

KernelStatus holds a kernel state, for status broadcast messages.

type OutputMsg

type OutputMsg struct {
	Execcount int                    `json:"execution_count"`
	Data      map[string]string      `json:"data"`
	Metadata  map[string]interface{} `json:"metadata"`
}

OutputMsg holds the data for a pyout message.

type ShutdownReply

type ShutdownReply struct {
	Restart bool `json:"restart"`
}

ShutdownReply encodes a boolean indication of shutdown/restart

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL