Getting Started
Configuration
The easiest way to configure the SDK is to run the following command in your Python environment:
linq configure
You will be prompted to enter the following information:
API Domain
Auth0 Domain
Client ID
Attention
You may need to ask your Automata Customer Success Manager for a username and password.
Authentication
After configuring the SDK, you can authenticate with the following command:
linq auth login
This will prompt you to press enter, which will open a browser window to authenticate with LINQ Cloud. Once you have authenticated, you can close the browser window and return to the terminal.
Note
You will need to be a member of your organization’s LINQ Cloud account with the correct permissions to be able to successfully authenticate.
If you would like to log in without opening a browser window for machine-to-machine authentication, please refer to the CLI documentation.
Running a Simple Example
This example demonstrates how to write a simple workflow and validate it. The workflow has a single task that peels a sealed microplate. Copy the following code into a new Python file and run it.
import sys
from linq.client import Linq
from linq.task import ActionTask, LabwareOutput, StoredLabware
from linq.labware import LabwareLocation
from linq.utils import get_latest_scheduler_version
from linq.workcell import Instrument, TransportMatrix, TransportPath, Workcell
from linq.workflow import ActionTask, Labware, LabwareType, Workflow
# Define instruments and workcell
peeler = Instrument(
id="peeler_1",
name="Peeler 1",
type="peeler",
bench="robotA",
driver="brooks_xpeel_v1",
capacity=2,
config={},
)
workcell = Workcell(
instruments=[peeler],
transport_matrix=TransportMatrix(
default_transport_time=5,
paths=[
TransportPath(source="robotA", destination="robotA", time=15),
],
),
)
# Define labware
microplate_type = LabwareType(id="microplate_96")
microplate = Labware(
id="sample_microplate",
labware_type=microplate_type,
starting_location=LabwareLocation(
instrument=peeler,
slot=1,
),
batch=1,
)
# Define tasks
peel_microplate = ActionTask(
id="Peel Microplate",
description="Peel the microplate",
instrument_type=peeler.type,
action="peel",
time_estimate=20,
labware_sources=[StoredLabware(microplate, slot=1)],
labware_outputs=[LabwareOutput(microplate)],
)
# Create workflow
workflow = Workflow(
workcell=workcell,
name="Simple Example Workflow",
author="John Doe",
description="A simple example workflow",
version="1.0",
scheduler_version=get_latest_scheduler_version(),
labware_types=[microplate_type],
labware=[microplate],
tasks=[peel_microplate],
parameter_definitions=[],
)
if __name__ == "__main__":
linq = Linq()
print("Validating workflow...")
result = linq.validate_workflow(workflow)
if result.is_valid:
print("Workflow is valid")
else:
print("Workflow is invalid")
sys.exit(1)
Note
You should see Workflow is valid
in your console output.
These commands are also available via the CLI.