kernel

IPythonKernel based on pystata

The latest documentation for implementing a wrapper kernel is here, but the current code deviates from those instructions (which call for inheriting from kernelbase.Kernel), instead inheriting from the IPython kernel implementation, IPythonKernel.

For a diagram of the main dependencies among the principal nbstata modules, click here.


source

PyStataKernel


def PyStataKernel(
    kwargs:VAR_KEYWORD
):

A jupyter kernel based on pystata

Config and Stata initialization

Stata is initialized during the execution of the first cell (in PyStataKernel.do_execute below) so that any configuration errors can be displayed in the notebook.


source

PyStataKernel.init_session


def init_session(
    
):

Stata code execution (and error display)


source

PyStataKernel.post_do_hook


def post_do_hook(
    
):

source

PyStataKernel.do_execute


def do_execute(
    code, silent, store_history:bool=True, user_expressions:NoneType=None, allow_stdin:bool=False
):

Execute Stata code cell

Other kernel capabilities


source

PyStataKernel.do_inspect


def do_inspect(
    code, cursor_pos, detail_level:int=0, omit_sections:tuple=()
):

Display Stata ‘describe’ output (regardless of cursor position)


source

PyStataKernel.do_complete


def do_complete(
    code, cursor_pos
):

Provide context-aware tab-autocomplete suggestions


source

PyStataKernel.do_is_complete


def do_is_complete(
    code
):

Overrides IPythonKernel with kernelbase default


source

PyStataKernel.do_history


def do_history(
    hist_access_type, output, raw, session:NoneType=None, start:NoneType=None, stop:NoneType=None, n:NoneType=None,
    pattern:NoneType=None, unique:bool=False
):

Overrides IPythonKernel with kernelbase default