idmtools.registry.task_specification module

TaskSpecification provided definition for the experiment plugin specification, hooks, and plugin manager.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools.registry.task_specification.TaskSpecification

Bases: PluginSpecification, ABC

TaskSpecification is spec for Task plugins.

classmethod get_name(strip_all: bool = True) str

Get name of plugin. By default we remove the PlatformSpecification portion.

Parameters:
  • strip_all – When true, TaskSpecification and TaskSpec is stripped from name. When false only

  • Stripped (Specification and Spec is) –

Returns:

Name of plugin

get(configuration: dict) ITask

Return a new model using the passed in configuration.

Parameters:

configuration – The INI configuration file to use.

Returns:

The new model.

get_type() Type[ITask]

Get task type.

Returns:

Task type

class idmtools.registry.task_specification.TaskPlugins(strip_all: bool = True)

Bases: SingletonMixin

TaskPlugins acts as a registry for Task Plugins.

__init__(strip_all: bool = True) None

Initialize the Task Registry. When strip all is false, the full plugin name will be used for names in map.

Parameters:

strip_all – Whether to strip common parts of name from plugins in plugin map

get_plugins() Set[TaskSpecification]

Get plugins for Tasks.

Returns:

Plugins

get_plugin_map() Dict[str, TaskSpecification]

Get a map of task plugins.

Returns:

Task plugin map