spinetoolbox.widgets.julia_repl_widget

Class for a custom SpineConsoleWidget to use as julia REPL.

author:
  1. Marin (KTH)
date:

22.5.2018

Module Contents

class spinetoolbox.widgets.julia_repl_widget.CustomQtKernelManager[source]

Bases: qtconsole.manager.QtKernelManager

A QtKernelManager with a custom restarter, and a means to override the –project argument.

kernel_left_dead[source]
project_path[source]
kernel_spec[source]
override_project_arg(self)[source]
start_restarter(self)[source]

Starts a restarter with custom time to dead and restart limit.

_handle_kernel_left_dead(self)[source]
class spinetoolbox.widgets.julia_repl_widget.JuliaREPLWidget(toolbox)[source]

Bases: spinetoolbox.widgets.spine_console_widget.SpineConsoleWidget

Class for a custom SpineConsoleWidget.

Parameters:toolbox (ToolboxUI) – QMainWindow instance
name = Julia Console[source]
julia_kernel_name(self)[source]

Returns the name of the julia kernel specification according to the julia executable selected in settings. Returns None if julia version cannot be determined.

Returns:str, NoneType
start_jupyter_kernel(self)[source]

Starts a Julia Jupyter kernel if available.

_do_start_jupyter_kernel(self, kernel_name=None)[source]

Starts a Jupyter kernel with the specified name.

Parameters:kernel_name (str, optional) –
handle_repl_failed_to_start(self)[source]

Tries using IJulia.

Returns:True, False, or None if unable to determine.
Return type:(bool, NoneType)
_try_installing_ijulia(self)[source]

Prompts user to install IJulia.

_do_try_installing_ijulia(self)[source]
_try_rebuilding_ijulia(self)[source]
restart_jupyter_kernel(self)[source]

Restarts the julia jupyter kernel if it’s already started. Starts a new kernel if none started or if the julia version has changed in Settings.

setup_client(self)[source]
_handle_kernel_restarted(self, died=True)[source]

Called when the kernel is restarted, i.e., when time to dead has elapsed.

_handle_kernel_left_dead(self)[source]

Called when the kernel is finally declared dead, i.e., the restart limit has been reached.

handle_ijulia_installation_finished(self, ret)[source]

Runs when IJulia installation process finishes

handle_ijulia_rebuild_finished(self, ret)[source]

Runs when IJulia rebuild process finishes

handle_ijulia_process_finished(self, ret, process)[source]

Checks whether or not the IJulia process finished successfully.

_handle_execute_reply(self, msg)[source]
_handle_status(self, msg)[source]

Handles status message.

_handle_error(self, msg)[source]

Handle error messages.

wake_up(self)[source]

See base class.

shutdown_jupyter_kernel(self)[source]

Shut down the jupyter kernel.

_context_menu_make(self, pos)[source]

Reimplemented to add an action for (re)start REPL action.

enterEvent(self, event)[source]

Set busy cursor during REPL (re)starts.

dragEnterEvent(self, e)[source]

Don’t accept drops from Add Item Toolbar.

copy_input(self)[source]

Copy only input.

_is_complete(self, source, interactive)[source]

See base class.