exopy.measurement.engines.base_engine module

Base classes for all engines

class exopy.measurement.engines.base_engine.ExecutionInfos[source]

Bases: atom.atom.Atom

Information necessary for engine to execute a task.

This object is also used by the engine to provide feedback about the execution of the task.

id

Id used to identify the task in logger messages.

task

Task to execute.

build_deps

Build dependencies. This allow to rebuild the task if necessary.

runtime_deps

Runtime dependencies of the task.

observed_entries

List of entries for which the engine should send updates during processing.

checks

Boolean indicating whether the engine should run the checks of the task.

success

Boolean set by the engine, indicating whether or not the task was successfully executed.

errors

Errors which occured during the execution of the task if any.

class exopy.measurement.engines.base_engine.BaseEngine[source]

Bases: atom.atom.Atom

Base class for all engines.

declaration

Declaration defining this engine.

status

Current status of the engine.

progress

Signal used to pass news about the measurement progress.

perform(exec_infos)[source]

Execute a given task and catch any error.

Parameters

exec_infos (ExecutionInfos) – TaskInfos object describing the work to expected of the engine.

Returns

exec_infos – Input object whose values have been updated. This is simply a convenience.

Return type

ExecutionInfos

pause()[source]

Ask the engine to pause the execution.

This method should not wait for the task to pause to return. When the pause is effective the engine should signal it by updating its status.

resume()[source]

Ask the engine to resume the execution.

This method should not wait for the measurement to resume. When the pause is over the engine should signal it by updating its status.

stop(force=False)[source]

Ask the engine to stop the execution.

This method should not wait for the execution to stop save if a forced stop was requested.

Parameters

force (bool, optional) – Force the engine to stop the performing the task. This allow the engine to use any means necessary to stop, in this case only should the call to this method block.

shutdown(force=False)[source]

Ask the engine to stop completely.

After a call to this method the engine may need to re-initialize a number of things before running the next task. This method should not wait for the engine to shutdown save if a forced stop was requested.

Parameters

force (bool, optional) – Force the engine to stop the performing the task. This allow the engine to use any means necessary to stop, in this case only should the call to this method block.

class exopy.measurement.engines.base_engine.Engine(parent=None, **kwargs)[source]

Bases: enaml.core.declarative.Declarative

A declarative class for contributing an engine.

Engine object can be contributed as extensions child to the ‘engines’ extension point of the ‘exopy.measurement’ plugin.

The name member inherited from enaml.core.Object should always be set to an easily understandable name for the user.

id

Unique name used to identify the engine. Should be user understandable.

description

Description of the engine

new(workbench, default=True)[source]

Create a new instance of the engine.

Parameters
  • workbench (Workbench) – Reference to the application workbench.

  • default (bool) – Whether to use default parameters or not when creating the object.

react_to_selection(workbench)[source]

Take any necessary actions when the engine is selected.

This method is called by the framework at the appropriate time.

react_to_unselection(workbench)[source]

Take any necessary actions when the engine is unselected.

This method is called by the framework at the appropriate time.

contribute_to_workspace(workspace)[source]

Add contributions to the workspace.

This method is called by the framework only if the engine is selected and the workspace is active.

clean_workspace(workspace)[source]

Remove any contributions from the workspace.

This method is called by the framework only the workspace is active and the engine is unselected.