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:
option (any 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.values (object) – A required value. This defaults to
anythingindicating that the only requirement is that theoptionexists. It can be useful to specifynot_nonewhich indicates that the requirement is satisfied if theoptionexists and it holds a value that is notNone. Values also supports iterables or singular values.state (Function) – A requirement on workflow state. This must be a function that accepts a single argument, and returns
Trueto indicate the requirement is satisfied, orFalseto indicate the requirement is not satisfied. This method will be passed the containingWorkflow``s' ``statemember variable.
Built-ins
__call__(func)Wrap a function
Helper for pickle.
__hash__()Return hash(self).
Methods