How to visualize the lattice#

Lattices have a built-in tool allowing convenient visualization of the workflow. First, define the lattice.

[1]:
import covalent as ct


@ct.electron
def identity(x):
    return x


@ct.electron
def square(x):
    return x * x


@ct.lattice
def workflow(a):
    val_1 = identity(x=a)
    return square(x=val_1)

[3]:
dispatch_id = ct.dispatch(workflow)(a=1)

[2]:
from IPython import display
display.Image("images/visualize_lattice.png", height="20pc")
[2]:
../../_images/how_to_orchestration_visualize_lattice_3_0.png
[ ]: