exopy.tasks.declarations module

Enaml objects used to declare tasks and interfaces in a plugin manifest.

exopy.tasks.declarations.check_children(declarator)[source]

Make sure that all the children of a declarator are interfaces.

Returns

msg – Error message if one wrongly-typed child was found or None

Return type

unicode or None

class exopy.tasks.declarations.Tasks(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.GroupDeclarator

GroupDeclarator for tasks.

Tasks will be stored according to the group of their parent.

class exopy.tasks.declarations.Task(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.Declarator

Declarator used to contribute a task.

task

Path to the task object. Path should be dot separated and the class name preceded by ‘:’. ex: exopy.tasks.tasks.logic.loop_task:LoopTask The path of any parent GroupDeclarator object will be prepended to it. To update existing TaskInfos (only instruments and interfaces can be updated that way), one can specify the name of the top level package in which the task is defined followed by its name. ex: exopy.LoopTask

view

Path to the view object associated with the task. The path of any parent GroupDeclarator object will be prepended to it.

metadata

loopable = True

Type

Metadata associated to the task. ex

instruments

List of supported driver ids.

dependencies

Runtime dependencies analyser ids corresponding to the runtime dependencies of the task (there is no need to list the instruments related dependencies as those are handled in a different fashion).

id

Id of the task computed from the top-level package and the task name

register(collector, traceback)[source]

Collect task and view and add infos to the DeclaratorCollector contributions member.

The group declared by a parent if any is taken into account. All Interface children are also registered.

unregister(collector)[source]

Remove contributed infos from the collector.

class exopy.tasks.declarations.Interfaces(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.GroupDeclarator

GroupDeclarator for interfaces.

The group value is not used by interfaces.

class exopy.tasks.declarations.Interface(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.Declarator

Declarator for task interfaces.

An interface can be declared as a child of the task to which its contribute in which case the task member can be omitted.

interface

Path to the interface object. Path should be dot separated and the class name preceded by ‘:’. If only the interface name is provided it will be used to update the corresponding InterfaceInfos. Example : exopy.tasks.tasks.logic.loop_linspace_interface:LinspaceLoopInterface The path of any parent GroupDeclarator object will be prepended to it.

views

Path or tuple of paths to the view objects associated with the interface The path of any parent GroupDeclarator object will be prepended to it.

extended

Name of the task/interfaces to which this interface contribute. If this interface contributes to a task then the task id is enough, if it contributes to an interface a list with the ids of the tasks and all intermediate interfaces id should be provided. When declared as a child of a Task/Interface the names are inferred from the parents.

instruments

List of supported driver names.

dependencies

Runtime dependencies analyser ids corresponding to the runtime dependencies of the interface (there is no need to list the instruments related dependencies as those are handled in a different fashion).

id

Id of the interface computed from the parents ids and the interface name

register(collector, traceback)[source]

Collect interface and views and add infos to the collector.

unregister(collector)[source]

Remove contributed infos from the collector.

class exopy.tasks.declarations.TaskConfigs(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.GroupDeclarator

GroupDeclarator for task configs.

class exopy.tasks.declarations.TaskConfig(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.Declarator

Declarator used to declare a task config.

config

Path to the config object. Path should be dot separated and the class name preceded by ‘:’. ex: exopy.tasks.config.base_config:PyConfigTask The path of any parent GroupDeclarator object will be prepended to it.

view

Path to the view object associated with the task. The path of any parent GroupDeclarator object will be prepended to it.

id

Id of the config computed from the top-level package and the config name

get_task_class()[source]

Return the base task class this config is used for.

register(collector, traceback)[source]

Collect config and view and add infos to the DeclaratorCollector contributions member under the supported task name.

unregister(collector)[source]

Remove contributed infos from the collector.