openfe.execute_DAG(protocoldag: ProtocolDAG, *, shared_basedir: Path, scratch_basedir: Path, cache_basedir: Path | None = None, stderr_basedir: Path | None = None, stdout_basedir: Path | None = None, keep_shared: bool = False, keep_scratch: bool = False, keep_cache: bool = False, raise_error: bool = True, n_retries: int = 0) ProtocolDAGResult#

Locally execute a full ProtocolDAG in serial and in-process.

Parameters:
  • protocoldag (ProtocolDAG) – The :class:ProtocolDAG to execute.

  • shared_basedir (Path) – Filesystem path to use for shared space that persists across whole DAG execution. Used by a ProtocolUnit to pass file contents to dependent class:ProtocolUnit instances.

  • scratch_basedir (Path) – Filesystem path to use for ProtocolUnit scratch space.

  • cache_basedir (Path | None = None) – Filesystem path to use for ProtocolUnitResult caching during execution. If None (default), results will not be cached and it will not be able to resume DAG execution from the last successfully finished ProtocolUnit.

  • stderr_basedir (Path | None) – Filesystem path to use for ProtocolUnit stderr archiving.

  • stdout_basedir (Path | None) – Filesystem path to use for ProtocolUnit stdout archiving.

  • keep_shared (bool) – If True, don’t remove shared directories for ProtocolUnit`s after the `ProtocolDAG is executed.

  • keep_scratch (bool) – If True, don’t remove scratch directories for a ProtocolUnit after it is executed.

  • keep_cache (bool) – If True, don’t remove the cache directory which contains the serialized ProtocolUnitResult for all executed ProtocolUnit/s.

  • raise_error (bool) – If True, raise an exception if a ProtocolUnit fails, default True if False, any exceptions will be stored as ProtocolUnitFailure objects inside the returned ProtocolDAGResult

  • n_retries (int) – the number of times to attempt, default 0, i.e. try once and only once

Returns:

The result of executing the ProtocolDAG.

Return type:

ProtocolDAGResult

Raises:

ProtocolDAGExecutionError – If the ProtocolDAG cannot be executed due to an invalid cache state.