Constructing a Workflow (Lattice)
Lattices are workflows comprised of a sequence of tasks. In your Python code, a lattice is a function with the @lattice
decorator.
To construct a lattice, do the following.
Prerequisites
Construct one or more electrons with which to compose the lattice:
import covalent as ct
@ct.electron
def quadrature(x, y):
return sqrt(x**2 + y**2)
Procedure
- Write a function that uses one or more electrons to process the data.
- Attach the
@lattice
decorator.
@ct.lattice
def quad_workflow(x, y):
return quadrature(x, y)