-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): Add metadata to session for Python protocols (#2799)
* feat(api): Add metadata to session for Python protocols. Closes #2616
- Loading branch information
Showing
14 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,9 +59,17 @@ If we were to rewrite this with the Opentrons API, it would look like the follow | |
# imports | ||
from opentrons import labware, instruments | ||
# metadata | ||
metadata = { | ||
'protocolName': 'My Protocol', | ||
'author': 'Name <[email protected]>', | ||
'description': 'Simple protocol to get started using OT2', | ||
'source': 'Opentrons Protocol Tutorial' | ||
} | ||
# labware | ||
plate = labware.load('96-flat', '2') | ||
tiprack = labware.load('tiprack-200ul', '1') | ||
tiprack = labware.load('opentrons-tiprack-300ul', '1') | ||
# pipettes | ||
pipette = instruments.P300_Single(mount='left', tip_racks=[tiprack]) | ||
|
@@ -74,12 +82,13 @@ If we were to rewrite this with the Opentrons API, it would look like the follow | |
How it's Organized | ||
------------------ | ||
|
||
When writing protocols using the Opentrons API, there are generally three sections: | ||
When writing protocols using the Opentrons API, there are generally five sections: | ||
|
||
1) Imports | ||
2) Labware | ||
3) Pipettes | ||
4) Commands | ||
2) Metadata | ||
3) Labware | ||
4) Pipettes | ||
5) Commands | ||
|
||
Imports | ||
^^^^^^^ | ||
|
@@ -93,6 +102,13 @@ From the example above, the "imports" section looked like: | |
from opentrons import labware, instruments | ||
Metadata | ||
^^^^^^^^ | ||
|
||
Metadata is a dictionary of data that is read by the server and returned to client applications (such as the Opentrons Run App). It is not needed to run a protocol (and is entirely optional), but if present can help the client application display additional data about the protocol currently being executed. | ||
|
||
The fields above ("protocolName", "author", "description", and "source") are the recommended fields, but the metadata dictionary can contain fewer fields, or additional fields as desired (though non-standard fields may not be rendered by the client, depending on how it is designed). | ||
|
||
Labware | ||
^^^^^^^ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,13 @@ | |
3. Tests different constructor set-ups | ||
""" | ||
|
||
metadata = { | ||
'protocolName': 'Everything Test', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A protocol for exercising the API', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
# Labware Set-up | ||
# Test whether slot naming conventions hold true | ||
tiprack = labware.load('tiprack-200ul', '1') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Bradford Assay', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A protien quantification assay', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
tiprack = containers.load('tiprack-200ul', '9') | ||
tiprack2 = containers.load('tiprack-200ul', '11') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
# validate labware calibration instrument selection | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Calibration Validation', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'For validating the accuracy of a pipette', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
tiprack_s1 = containers.load('tiprack-200ul', '6', label='s1') | ||
tiprack_s2 = containers.load('tiprack-200ul', '3', label='s2') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Dinosaur', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'Simple protocol to draw a dinosaur in a 96 well plate', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
# a 12 row trough for sources, and 96 well plate for output | ||
trough = containers.load('trough-12row', '3', 'trough') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Multi-only', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A protocol that only uses an 8-channel pipette', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
tiprack = containers.load('tiprack-200ul', '8') | ||
trough = containers.load('trough-12row', '9') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Multi/Single', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A protocol that uses both 8- and 1-channel pipettes', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
# from opentrons import robot | ||
# robot.connect() | ||
# robot.home() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'No-clear-tips', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A test protocol that does not drop tips at the end', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
# a 12 row trough for sources, and 96 well plate for output | ||
trough = containers.load('trough-12row', '3', 'trough') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Pickup accuracy', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A protocol for testing pick up and drop tip', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
# from opentrons import robot | ||
# robot.connect() | ||
# robot.home() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments | ||
|
||
metadata = { | ||
'protocolName': 'Smoke', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'Simple protocol to test the server', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
tiprack = containers.load('tiprack-200ul', '8') | ||
plate = containers.load('96-PCR-flat', '5') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from opentrons import containers, instruments, robot | ||
|
||
metadata = { | ||
'protocolName': 'Testosaur', | ||
'author': 'Opentrons <[email protected]>', | ||
'description': 'A variant on "Dinosaur" for testing', | ||
'source': 'Opentrons Repository' | ||
} | ||
|
||
p200rack = containers.load('tiprack-200ul', '5', 'tiprack') | ||
|
||
# create a p200 pipette on robot axis B | ||
|