exopy.measurement.hooks.base_hooks module

Base classes for all measurement hooks.

class exopy.measurement.hooks.base_hooks.BaseExecutionHook[source]

Bases: exopy.measurement.base_tool.BaseMeasureTool

Base class for all measurement hooks (pre or post execution).

The execution management methods (pause, resume, stop) need to be implemented only if the execution of the hook is lengthy (this applies to hook executing tasks).

paused

Event which the hook should fired (with a value of True) when it succeded to pause.

resumed

Event which the hook should fired (with a value of True) when it succeded to resume.

run(workbench, engine)[source]

Perform additional operations before/after the measurement.

This method can raise errors as necessary.

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

  • engine (Engine) – Active engine that can be used to execute tasks.

pause()[source]

Pause the execution of the hook.

This call should not block waiting for the pause to occur. The paused signal should be fired once the pause is achieved.

resume()[source]

Resume the execution of the hook.

This call should not block waiting for the resuming to occur. The resumed signal should be fired once the execution resumed.

stop(force=False)[source]

Stop the execution of the hook.

This call should not block save if the force keyword is true. No signal is emitted as the run method should return as a result of the stop.

list_runtimes(workbench)[source]

List the runtimes dependencies for this hook.

Parameters

workbench – Workbench of the application.

Returns

runtime – Runtime dependencies as returned by a call to the command ‘exopy.app.dependencies.analyse’. None means that the hook has no runtime dependency.

Return type

RuntimeContainer | None

class exopy.measurement.hooks.base_hooks.BasePreExecutionHook[source]

Bases: exopy.measurement.hooks.base_hooks.BaseExecutionHook

Base class for pre-execution measurement hooks.

Notes

This kind of hook can contribute entries to the task database. If it does so it should register those entries (add their name and a default value) at the root level of the database at linking time so that they appear in the autocompletion.

class exopy.measurement.hooks.base_hooks.BasePostExecutionHook[source]

Bases: exopy.measurement.hooks.base_hooks.BaseExecutionHook

Base class for post-execution measurement hooks.

class exopy.measurement.hooks.base_hooks.PreExecutionHook(parent=None, **kwargs)[source]

Bases: exopy.measurement.base_tool.BaseToolDeclaration

A declarative class for contributing a measurement pre-execution.

PreExecutionHook object can be contributed as extensions child to the ‘pre-execution’ extension point of the ‘exopy.measurement’ plugin.

class exopy.measurement.hooks.base_hooks.PostExecutionHook(parent=None, **kwargs)[source]

Bases: exopy.measurement.base_tool.BaseToolDeclaration

A declarative class for contributing a measurement post-execution.

PostExecutionHook object can be contributed as extensions child to the ‘post-execution’ extension point of the ‘exopy.measurement’ plugin.