Skip to main content

Constructing a Workflow (Lattice) GoToimage

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

  1. Write a function that uses one or more electrons to process the data.
  2. Attach the @lattice decorator.
@ct.lattice
def quad_workflow(x, y):
return quadrature(x, y)

See Also

Constructing an Electron

Adding Electrons to Lattices