WorkflowGraph

class propertyestimator.workflow.WorkflowGraph[source]

A hierarchical structure for storing and submitting the workflows which will estimate a set of physical properties..

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

add_workflow(workflow)

Insert a workflow into the workflow graph.

execute([root_directory, …])

Executes the workflow graph.

Attributes

dependants_graph

A dictionary of which stores which grouped protocols are dependant on other grouped protocols.

protocols

The protocols in this graph.

root_protocols

The ids of the protocols in the group which do not take input from the other grouped protocols.

property protocols

The protocols in this graph.

Type

dict of str and Protocol

property root_protocols

The ids of the protocols in the group which do not take input from the other grouped protocols.

Type

list of str

property dependants_graph

A dictionary of which stores which grouped protocols are dependant on other grouped protocols. Each key in the dictionary is the id of a grouped protocol, and each value is the id of a protocol which depends on the protocol by the key.

Type

dict of str and str

add_workflow(workflow)[source]

Insert a workflow into the workflow graph.

Parameters

workflow (Workflow) – The workflow to insert.

execute(root_directory='', calculation_backend=None, compute_resources=None)[source]

Executes the workflow graph.

Parameters
  • root_directory (str) – The directory to execute the graph in.

  • calculation_backend (CalculationBackend, optional.) – The backend to execute the graph on. This parameter is mutually exclusive with compute_resources.

  • compute_resources (CalculationBackend, optional.) – The compute resources to run using. If None and no calculation_backend is specified, the workflow will be executed on a single CPU thread. This parameter is mutually exclusive with calculation_backend.

Returns

The results of executing the graph. If a calculation_backend is specified, these results will be wrapped in a Future.

Return type

list of WorkflowResult or list of Future of WorkflowResult