exopy.tasks.filters module

Modules defining the basic filters.

The filter available by default are declared in the manager manifest.

class exopy.tasks.filters.TaskFilter(parent=None, **kwargs)[source]

Bases: exopy.utils.declarator.Declarator

Base class for all task filters.

id

Unique id of this filter (also used as a name).

filter_tasks(tasks, templates)[source]

Filter the task known by the manager.

By default all task are returned.

Parameters
  • tasks (dict) – Dictionary of known python tasks as name : TaskInfos.

  • templates (dict) – Dictionary of known templates as name : path

Returns

task_names – List of the name of the task matching the filters criteria.

Return type

list(str)

class exopy.tasks.filters.SubclassTaskFilter(parent=None, **kwargs)[source]

Bases: exopy.tasks.filters.TaskFilter

Filter keeping only the python tasks which are subclass of subclass.

subclass

Class from which the task must inherit.

filter_tasks(tasks, templates)[source]

Keep only the task inheriting from the right class.

class exopy.tasks.filters.MetadataTaskFilter(parent=None, **kwargs)[source]

Bases: exopy.tasks.filters.TaskFilter

Filter keeping only the python tasks with the right class attribute.

meta_key

Metadata key to match.

meta_value

Metadata value to match.

filter_tasks(tasks, templates)[source]

Keep only the task with the right class attribute.

class exopy.tasks.filters.GroupTaskFilter(parent=None, **kwargs)[source]

Bases: exopy.tasks.filters.MetadataTaskFilter

Filter keeping only the python tasks from the right group.

group

Group to which the tasks must belong.

meta_key

A value of type unicode.

By default, plain strings will be promoted to unicode strings. Pass strict=True to the constructor to enable strict unicode checking.

meta_value

A Member which behaves similar to a Python property.