Constructing a Task (Electron)#
An electron is a single task, the basic building block of a workflow. Construct an electron by writing a function that performs one step in a workflow.
Import the Covalent library. Do this in any file you write that uses the Covalent SDK.
import covalent as ct
To create an electron:
Define a function to perform a task.
def quadrature(x, y): return sqrt(x**2 + y**2)
@ct.electron def quadrature(x, y): return sqrt(x**2 + y**2)