exopy.measurement.base_tool module

Measurement tools are meant to specify actions not covered by the tasks.

The class defined here are not meant to be used directly. One should rather subclass one of their subclasses according to the kind of tool one wants to create.

The existing kind of tools are the following :

  • pre-measurement execution hook : used to perform additional operations before running a measurement. (see hooks package)

  • monitors : used to follow the progress of a measurement. (see monitors package)

  • post-measurement execution hook : used to perform additional operations after the measurement has been run. (see hooks package)

exopy.measurement.base_tool.tool_decl()[source]

Forward typing for the declaration member of the BaseMeasureTool.

exopy.measurement.base_tool.measurement()[source]

Delayed import to avoid circular import issues.

class exopy.measurement.base_tool.BaseMeasureTool[source]

Bases: exopy.utils.atom_util.HasPrefAtom

Base tool simply definig the expected interface.

measurement

Reference to the measurement to which that tool is linked (None if unlinked)

declaration

Reference to the declaration of this tool.

check(workbench, **kwargs)[source]

Ensure that the tool is properly configured and will be able to work

Parameters
  • workbench – Reference to the application workbench.

  • kwargs – Additional keywords providing infos about the context of execution. For example if any runtime dependencie is unavailable it will be listed in the missing keyword argument.

get_state()[source]

Get the current state of the tool. Used when saving.

set_state(state)[source]

Restore the state of the tool from a preferences dict.

Link this tool to a measurement.

Unlink this tool from the measurement to which it is linked.

class exopy.measurement.base_tool.BaseToolDeclaration(parent=None, **kwargs)[source]

Bases: enaml.core.declarative.Declarative

Base class for defining a measurement tool contribution.

id

Unique name used to identify the tool. The usual format is top_level_package_name.tool_name

description

Description of the tool.

has_view

Flag indicating whether the tool has an associated parametrisation widget.

new(workbench, default=True)[source]

Create a new instance of the tool.

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

  • default (bool, optional) – Flag indicating whether to use default parameters when creating the tool or not. Mainly used when loading a tool from a saved config.

make_view(workbench, tool)[source]

Create a widget to edit the tool parameters.

This widget should inherit from Container.