skbio.workflow.Workflow

class skbio.workflow.Workflow(state, short_circuit=True, debug=False, options=None, **kwargs)[source]

Arbitrary workflow support structure

Methods that are considered to be directly part of the workflow must be decorated with method. The workflow methods offer a mechanism to logically group functionality together, and are free to make subsequent calls to other methods.

All methods of a subclass of Workflow (those with and without the method decoration) can take advantage of the requires decorator to specify any option or state requirements for the decorated function.

Parameters:
  • state (object) – State can be anything or nothing. This is dependent on the workflow as in some cases, it is useful to preallocate state while in other workflows state may be ignored.
  • short_circuit (bool) – if True, enables ignoring function methods when a given item has failed
  • debug (bool) – Enable debug mode
  • options (dict) – runtime options, {‘option’:values}, that the requires decorator can interrogate.
  • kwargs (dict) – Additional arguments will be added as member variables to self. This is handy if additional contextual information is needed by a workflow method (e.g., a lookup table).

Built-ins

__call__(iter_[, success_callback, …]) Operate on all the data
__init_subclass__ This method is called when a class is subclassed.

Methods

initialize_state(item) Initialize state