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:

[1]:
import covalent as ct

@ct.electron
def quadrature(x, y):
    return sqrt(x**2 + y**2)

Procedure#

  1. Write a function that uses one or more electrons to process the data.

  2. Attach the @lattice decorator.

[2]:
@ct.lattice
def quad_workflow(x, y):
    return quadrature(x, y)

See Also#

Constructing an Electron

Adding Electrons to Lattices