maize#

This is the documentation for maize 0.4.1.

maize is a graph-based workflow manager for computational chemistry pipelines. It is based on the principles of flow-based programming and thus allows arbitrary graph topologies, including cycles, to be executed. Each task in the workflow (referred to as nodes) is run as a separate process and interacts with other nodes in the graph by communicating through unidirectional channels, connected to ports on each node. Every node can have an arbitrary number of input or output ports, and can read from them at any time, any number of times. This allows complex task dependencies and cycles to be modelled effectively.

Installation#

If you plan on using maize-contrib, then you should just follow the installation instructions for the latter. Maize will be installed automatically as a dependency.

To get started quickly with running maize, you can install from an environment file:

conda env create -f env-users.yml

Teaser#

A taste for defining and running workflows with maize.

 1"""A simple hello-world-ish example graph."""
 2
 3from maize.core.interface import Parameter, Output, MultiInput
 4from maize.core.node import Node
 5from maize.core.workflow import Workflow
 6
 7# Define the nodes
 8class Example(Node):
 9    data: Parameter[str] = Parameter(default="Hello")
10    out: Output[str] = Output()
11
12    def run(self) -> None:
13        self.out.send(self.data.value)
14
15
16class ConcatAndPrint(Node):
17    inp: MultiInput[str] = MultiInput()
18
19    def run(self) -> None:
20        result = " ".join(inp.receive() for inp in self.inp)
21        self.logger.info("Received: '%s'", result)
22
23
24# Build the graph
25flow = Workflow(name="hello")
26ex1 = flow.add(Example, name="ex1")
27ex2 = flow.add(Example, name="ex2", parameters=dict(data="maize"))
28concat = flow.add(ConcatAndPrint)
29flow.connect(ex1.out, concat.inp)
30flow.connect(ex2.out, concat.inp)
31
32# Check and run!
33flow.check()
34flow.execute()

Indices and tables#