ProtocolUnit
#
- class gufe.protocols.protocolunit.ProtocolUnit(*, name: str | None = None, **inputs)#
A unit of work within a ProtocolDAG.
Create an instance of a ProtocolUnit.
- Parameters:
name (str) – Custom name to give this
**inputs – Keyword arguments, which can include other ProtocolUnit`s on which this `ProtocolUnit is dependent. Should be either gufe objects or JSON-serializables.
Methods
Given ProtocolUnitResult s from dependencies, execute this ProtocolUnit.
Attributes
All units that this unit is dependent on (parents)
Inputs to the ProtocolUnit.
Optional name for the ProtocolUnit.
- property dependencies: list[ProtocolUnit]#
All units that this unit is dependent on (parents)
- execute(*, context: Context, raise_error: bool = False, **inputs) ProtocolUnitResult | ProtocolUnitFailure #
Given ProtocolUnitResult s from dependencies, execute this ProtocolUnit.
- Parameters:
context (Context) – Execution context for this ProtocolUnit; includes e.g.
shared
andscratch
Path s.raise_error (bool) – If True, raise any errors instead of catching and returning a ProtocolUnitFailure default False
**inputs – Keyword arguments giving the named inputs to _execute. These can include ProtocolUnitResult objects from ProtocolUnit objects this unit is dependent on.
- property inputs: Dict[str, Any]#
Inputs to the ProtocolUnit.
Includes any ProtocolUnit instances this ProtocolUnit depends on.
- property name: str | None#
Optional name for the ProtocolUnit.