skbio.workflow.requires#
- class skbio.workflow.requires(option=None, values=<skbio.workflow.Exists object>, state=None)[source]#
Decorator that executes a function if requirements are met.
- Parameters:
- optionany Hashable object
An option that is required for the decorated method to execute. This option will be looked up within the containing
Workflow``s' ``options
.- valuesobject
A required value. This defaults to
anything
indicating that the only requirement is that theoption
exists. It can be useful to specifynot_none
which indicates that the requirement is satisfied if theoption
exists and it holds a value that is notNone
. Values also supports iterables or singular values.- stateFunction
A requirement on workflow state. This must be a function that accepts a single argument, and returns
True
to indicate the requirement is satisfied, orFalse
to indicate the requirement is not satisfied. This method will be passed the containingWorkflow``s' ``state
member variable.
Built-ins
__call__
(func)Wrap a function.
__eq__
(value, /)Return self==value.
__ge__
(value, /)Return self>=value.
__getstate__
(/)Helper for pickle.
__gt__
(value, /)Return self>value.
__hash__
(/)Return hash(self).
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__str__
(/)Return str(self).
Methods