spinetoolbox.spine_engine_manager

Contains SpineEngineManagerBase.

authors
  1. Marin (KTH)

date

14.10.2020

Module Contents

Classes

SpineEngineManagerBase

RemoteSpineEngineManager

param engine_server_address

LocalSpineEngineManager

Functions

make_engine_manager(engine_server_address)

class spinetoolbox.spine_engine_manager.SpineEngineManagerBase[source]
abstract run_engine(self, engine_data)[source]

Runs an engine with given data.

Parameters

engine_data (dict) – The engine data.

abstract get_engine_event(self)[source]

Gets next event from engine currently running.

Returns

two element tuple: event type identifier string, and event data dictionary

Return type

tuple(str,dict)

abstract stop_engine(self)[source]

Stops engine currently running.

abstract restart_kernel(self, connection_file)[source]

Restarts the jupyter kernel associated to given connection file.

Parameters

connection_file (str) – path of connection file

abstract shutdown_kernel(self, connection_file)[source]

Shuts down the jupyter kernel associated to given connection file.

Parameters

connection_file (str) – path of connection file

class spinetoolbox.spine_engine_manager.RemoteSpineEngineManager(engine_server_address)[source]

Bases: SpineEngineManagerBase

Parameters

engine_server_address (str) –

_ENCODING = ascii[source]
run_engine(self, engine_data)[source]

See base class.

get_engine_event(self)[source]

See base class.

stop_engine(self)[source]

See base class.

restart_kernel(self, connection_file)[source]

See base class.

shutdown_kernel(self, connection_file)[source]

See base class.

_send(self, request, *args, receive=True)[source]

Sends a request to the server with the given arguments.

Parameters
  • request (str) – One of the supported engine server requests

  • args – Request arguments

  • receive (bool, optional) – If True (the default) also receives the response and returns it.

Returns

response, or None if receive is False

Return type

str or NoneType

_recvall(self)[source]

Receives and returns all data in the current request.

Returns

str

class spinetoolbox.spine_engine_manager.LocalSpineEngineManager[source]

Bases: SpineEngineManagerBase

run_engine(self, engine_data)[source]

Runs an engine with given data.

Parameters

engine_data (dict) – The engine data.

get_engine_event(self)[source]

Gets next event from engine currently running.

Returns

two element tuple: event type identifier string, and event data dictionary

Return type

tuple(str,dict)

stop_engine(self)[source]

Stops engine currently running.

restart_kernel(self, connection_file)[source]

Restarts the jupyter kernel associated to given connection file.

Parameters

connection_file (str) – path of connection file

shutdown_kernel(self, connection_file)[source]

Shuts down the jupyter kernel associated to given connection file.

Parameters

connection_file (str) – path of connection file

spinetoolbox.spine_engine_manager.make_engine_manager(engine_server_address)[source]