poppy.core.task module

class poppy.core.task.Task(instance_name=None)[source]

Bases: poppy.core.task.base_task.BaseTask

classmethod add_input(target_class, identifier, *args, **kwargs)[source]
classmethod add_output(target_class, identifier, *args, **kwargs)[source]
add_targets()[source]

Method to override to add targets

Returns:
classmethod as_task(run_func=None, *, plugin_name=None, name=None)[source]

Use the decorated function as a task

Parameters:
  • run_func – the decorated function
  • plugin_name – the plugin name
  • name – the task name
Returns:

a task class that run the decorated function

classmethod get_descriptor()[source]
classmethod get_plugin()[source]
input()[source]
inputs

Generate a subset of the pipeline targets containing only the task inputs

Returns:the input targets
instantiate_target(target_list, target_definition)[source]

Instantiate a new target using the given definition and store the target id in a list

Parameters:
  • target_list – the list used to store the target ids
  • target_definition – the target definition
Returns:

instantiate_targets()[source]
classmethod legacy_as_task(run_func=None, *, plugin_name=None, name=None, legacy=True)[source]

Method used to ensure backward compatibility with the previous decorator API

Parameters:
  • run_func – the decorated function
  • plugin_name – the plugin name
  • name – the task name
  • legacy – flag indicating which API is used (the legacy or the new one)
Returns:

a task class that run the decorated function

output()[source]
outputs

Generate a subset of the pipeline targets containing only the task outputs

Returns:the output targets
static to_camel_case(snake_str)[source]
exception poppy.core.task.TaskError[source]

Bases: Exception

Error associated to tasks.