@opentrons/shared-data 0.0.1-alpha.20 → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +1 -1
- package/lib/opentrons-shared-data.js +1 -1
- package/lib/opentrons-shared-data.js.map +1 -1
- package/package.json +1 -1
- package/js/__tests__/__snapshots__/pipettes.test.ts.snap +0 -5969
- package/js/__tests__/deckSchemas.test.ts +0 -87
- package/js/__tests__/errors.test.js +0 -21
- package/js/__tests__/getAreSlotsAdjacent.test.ts +0 -128
- package/js/__tests__/getWellNamePerMultiTip.test.ts +0 -162
- package/js/__tests__/labwareDefQuirks.test.ts +0 -37
- package/js/__tests__/labwareDefSchemaV1.test.ts +0 -82
- package/js/__tests__/labwareDefSchemaV2.test.ts +0 -298
- package/js/__tests__/moduleAccessors.test.ts +0 -50
- package/js/__tests__/moduleSpecsSchema.test.ts +0 -77
- package/js/__tests__/pipetteSchemaV2.test.ts +0 -107
- package/js/__tests__/pipetteSpecSchemas.test.ts +0 -48
- package/js/__tests__/pipettes.test.ts +0 -58
- package/js/__tests__/protocolSchemaV4.test.ts +0 -137
- package/js/__tests__/protocolSchemaV5.test.ts +0 -137
- package/js/__tests__/protocolSchemaV6.test.ts +0 -132
- package/js/__tests__/protocolSchemaV7.test.ts +0 -64
- package/js/__tests__/protocolValidation.test.ts +0 -83
- package/js/__tests__/sortWells.test.ts +0 -40
- package/js/__tests__/splitWellsOnColumn.test.ts +0 -21
- package/js/__tests__/validateErrors.test.js +0 -34
- package/js/constants.ts +0 -338
- package/js/cypressUtils.ts +0 -35
- package/js/errors.ts +0 -33
- package/js/fixtures.ts +0 -161
- package/js/getLabware.ts +0 -154
- package/js/gripper.ts +0 -29
- package/js/helpers/__tests__/getAdapterName.test.ts +0 -31
- package/js/helpers/__tests__/getDeckDefFromLoadedLabware.test.ts +0 -12
- package/js/helpers/__tests__/getVectorDifference.test.ts +0 -25
- package/js/helpers/__tests__/getVectorSum.test.ts +0 -21
- package/js/helpers/__tests__/labwareInference.test.ts +0 -84
- package/js/helpers/__tests__/orderWells.test.ts +0 -87
- package/js/helpers/__tests__/parseProtocolData.test.ts +0 -165
- package/js/helpers/__tests__/volume.test.ts +0 -108
- package/js/helpers/__tests__/wellSets.test.ts +0 -352
- package/js/helpers/get96Channel384WellPlateWells.ts +0 -44
- package/js/helpers/getAddressableAreasInProtocol.ts +0 -59
- package/js/helpers/getLoadedLabwareDefinitionsByUri.ts +0 -30
- package/js/helpers/getModuleVizDims.ts +0 -118
- package/js/helpers/getOccludedSlotCountForModule.ts +0 -13
- package/js/helpers/getVectorDifference.ts +0 -12
- package/js/helpers/getVectorSum.ts +0 -12
- package/js/helpers/getWellNamePerMultiTip.ts +0 -86
- package/js/helpers/getWellTotalVolume.ts +0 -16
- package/js/helpers/index.ts +0 -347
- package/js/helpers/labwareInference.ts +0 -92
- package/js/helpers/orderWells.ts +0 -69
- package/js/helpers/parseProtocolData.ts +0 -141
- package/js/helpers/volume.ts +0 -35
- package/js/helpers/wellIsRect.ts +0 -6
- package/js/helpers/wellSets.ts +0 -155
- package/js/index.ts +0 -14
- package/js/labwareTools/__tests__/__snapshots__/createIrregularLabware.test.ts.snap +0 -3
- package/js/labwareTools/__tests__/__snapshots__/createLabware.test.ts.snap +0 -3
- package/js/labwareTools/__tests__/createDefaultDisplayName.test.ts +0 -111
- package/js/labwareTools/__tests__/createIrregularLabware.test.ts +0 -226
- package/js/labwareTools/__tests__/createLabware.test.ts +0 -147
- package/js/labwareTools/index.ts +0 -452
- package/js/modules.ts +0 -97
- package/js/pipettes.ts +0 -89
- package/js/protocols.ts +0 -290
- package/js/schema.ts +0 -80
- package/js/scripts/generateDeckLayersFromSVG.js +0 -46
- package/js/titleCase.ts +0 -30
- package/js/types.ts +0 -600
- package/python/.coveragerc +0 -4
- package/python/.flake8 +0 -32
- package/python/Config.in +0 -10
- package/python/Makefile +0 -134
- package/python/Pipfile +0 -28
- package/python/Pipfile.lock +0 -645
- package/python/buildroot.mk +0 -30
- package/python/mypy.ini +0 -41
- package/python/opentrons_shared_data/__init__.py +0 -17
- package/python/opentrons_shared_data/_version.py +0 -20
- package/python/opentrons_shared_data/command/__init__.py +0 -52
- package/python/opentrons_shared_data/deck/__init__.py +0 -96
- package/python/opentrons_shared_data/deck/dev_types.py +0 -180
- package/python/opentrons_shared_data/errors/__init__.py +0 -30
- package/python/opentrons_shared_data/errors/categories.py +0 -60
- package/python/opentrons_shared_data/errors/codes.py +0 -108
- package/python/opentrons_shared_data/errors/exceptions.py +0 -915
- package/python/opentrons_shared_data/gripper/__init__.py +0 -63
- package/python/opentrons_shared_data/gripper/constants.py +0 -6
- package/python/opentrons_shared_data/gripper/gripper_definition.py +0 -101
- package/python/opentrons_shared_data/labware/__init__.py +0 -22
- package/python/opentrons_shared_data/labware/constants.py +0 -7
- package/python/opentrons_shared_data/labware/dev_types.py +0 -140
- package/python/opentrons_shared_data/labware/labware_definition.py +0 -328
- package/python/opentrons_shared_data/load.py +0 -57
- package/python/opentrons_shared_data/module/__init__.py +0 -74
- package/python/opentrons_shared_data/module/dev_types.py +0 -141
- package/python/opentrons_shared_data/pipette/__init__.py +0 -107
- package/python/opentrons_shared_data/pipette/dev_types.py +0 -177
- package/python/opentrons_shared_data/pipette/file_operation_helpers.py +0 -37
- package/python/opentrons_shared_data/pipette/load_data.py +0 -261
- package/python/opentrons_shared_data/pipette/model_constants.py +0 -123
- package/python/opentrons_shared_data/pipette/mutable_configurations.py +0 -431
- package/python/opentrons_shared_data/pipette/pipette_definition.py +0 -503
- package/python/opentrons_shared_data/pipette/pipette_load_name_conversions.py +0 -240
- package/python/opentrons_shared_data/pipette/scripts/__init__.py +0 -0
- package/python/opentrons_shared_data/pipette/scripts/build_json_script.py +0 -469
- package/python/opentrons_shared_data/pipette/scripts/update_configuration_files.py +0 -450
- package/python/opentrons_shared_data/pipette/types.py +0 -193
- package/python/opentrons_shared_data/protocol/__init__.py +0 -13
- package/python/opentrons_shared_data/protocol/constants.py +0 -98
- package/python/opentrons_shared_data/protocol/dev_types.py +0 -436
- package/python/opentrons_shared_data/protocol/models/__init__.py +0 -48
- package/python/opentrons_shared_data/protocol/models/protocol_schema_v6.py +0 -145
- package/python/opentrons_shared_data/protocol/models/protocol_schema_v7.py +0 -95
- package/python/opentrons_shared_data/protocol/models/protocol_schema_v8.py +0 -110
- package/python/opentrons_shared_data/protocol/models/shared_models.py +0 -111
- package/python/opentrons_shared_data/py.typed +0 -0
- package/python/opentrons_shared_data/robot/__init__.py +0 -33
- package/python/opentrons_shared_data/robot/dev_types.py +0 -37
- package/python/pytest.ini +0 -2
- package/python/setup.cfg +0 -5
- package/python/setup.py +0 -179
- package/python/tests/__init__.py +0 -1
- package/python/tests/conftest.py +0 -0
- package/python/tests/deck/__init__.py +0 -0
- package/python/tests/deck/test_list_names.py +0 -12
- package/python/tests/deck/test_position.py +0 -113
- package/python/tests/deck/test_typechecks.py +0 -28
- package/python/tests/errors/__init__.py +0 -1
- package/python/tests/errors/test_error_completeness.py +0 -19
- package/python/tests/errors/test_exceptions.py +0 -74
- package/python/tests/gripper/__init__.py +0 -0
- package/python/tests/gripper/test_definition.py +0 -30
- package/python/tests/gripper/test_load.py +0 -16
- package/python/tests/labware/__init__.py +0 -13
- package/python/tests/labware/test_typechecks.py +0 -21
- package/python/tests/module/__init__.py +0 -20
- package/python/tests/module/test_load.py +0 -49
- package/python/tests/module/test_typechecks.py +0 -34
- package/python/tests/pipette/__init__.py +0 -0
- package/python/tests/pipette/test_load_data.py +0 -103
- package/python/tests/pipette/test_mutable_configurations.py +0 -266
- package/python/tests/pipette/test_pipette_definition.py +0 -183
- package/python/tests/pipette/test_pipette_load_name_conversions.py +0 -222
- package/python/tests/pipette/test_typechecks.py +0 -50
- package/python/tests/pipette/test_validate_schema.py +0 -37
- package/python/tests/protocol/__init__.py +0 -15
- package/python/tests/protocol/test_protocol_schema_v6.py +0 -107
- package/python/tests/protocol/test_protocol_schema_v7.py +0 -34
- package/python/tests/protocol/test_protocol_schema_v8.py +0 -20
- package/python/tests/protocol/test_typechecks.py +0 -36
- package/python/tests/robot/__init__.py +0 -0
- package/python/tests/robot/test_typechecks.py +0 -20
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field, validator
|
|
2
|
-
from typing import Any, List, Optional, Dict, Union
|
|
3
|
-
from typing_extensions import Literal
|
|
4
|
-
from opentrons_shared_data.labware.labware_definition import LabwareDefinition
|
|
5
|
-
|
|
6
|
-
from .shared_models import (
|
|
7
|
-
Liquid,
|
|
8
|
-
Labware,
|
|
9
|
-
CommandAnnotation,
|
|
10
|
-
Location,
|
|
11
|
-
ProfileStep,
|
|
12
|
-
WellLocation,
|
|
13
|
-
OffsetVector,
|
|
14
|
-
Metadata,
|
|
15
|
-
Module,
|
|
16
|
-
Pipette,
|
|
17
|
-
Robot,
|
|
18
|
-
DesignerApplication,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# TODO (tamar 3/15/22): split apart all the command payloads when we tackle #9583
|
|
23
|
-
class Params(BaseModel):
|
|
24
|
-
slotName: Optional[str]
|
|
25
|
-
axes: Optional[List[str]]
|
|
26
|
-
pipetteId: Optional[str]
|
|
27
|
-
mount: Optional[str]
|
|
28
|
-
moduleId: Optional[str]
|
|
29
|
-
location: Optional[Union[Location, Literal["offDeck"]]]
|
|
30
|
-
labwareId: Optional[str]
|
|
31
|
-
displayName: Optional[str]
|
|
32
|
-
liquidId: Optional[str]
|
|
33
|
-
volumeByWell: Optional[Dict[str, Any]]
|
|
34
|
-
wellName: Optional[str]
|
|
35
|
-
volume: Optional[float]
|
|
36
|
-
flowRate: Optional[float]
|
|
37
|
-
wellLocation: Optional[Union[WellLocation]]
|
|
38
|
-
waitForResume: Optional[Literal[True]]
|
|
39
|
-
seconds: Optional[float]
|
|
40
|
-
minimumZHeight: Optional[float]
|
|
41
|
-
forceDirect: Optional[bool]
|
|
42
|
-
speed: Optional[float]
|
|
43
|
-
message: Optional[str]
|
|
44
|
-
coordinates: Optional[OffsetVector]
|
|
45
|
-
axis: Optional[str]
|
|
46
|
-
distance: Optional[float]
|
|
47
|
-
positionId: Optional[str]
|
|
48
|
-
temperature: Optional[float]
|
|
49
|
-
celsius: Optional[float]
|
|
50
|
-
blockMaxVolumeUl: Optional[float]
|
|
51
|
-
rpm: Optional[float]
|
|
52
|
-
height: Optional[float]
|
|
53
|
-
offset: Optional[OffsetVector]
|
|
54
|
-
profile: Optional[List[ProfileStep]]
|
|
55
|
-
radius: Optional[float]
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class Command(BaseModel):
|
|
59
|
-
commandType: str
|
|
60
|
-
params: Params
|
|
61
|
-
key: Optional[str]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class ProtocolSchemaV6(BaseModel):
|
|
65
|
-
otSharedSchema: Literal["#/protocol/schemas/6"] = Field(
|
|
66
|
-
...,
|
|
67
|
-
alias="$otSharedSchema",
|
|
68
|
-
description="The path to a valid Opentrons shared schema relative to "
|
|
69
|
-
"the shared-data directory, without its extension.",
|
|
70
|
-
)
|
|
71
|
-
schemaVersion: Literal[6]
|
|
72
|
-
metadata: Metadata
|
|
73
|
-
robot: Robot
|
|
74
|
-
pipettes: Dict[str, Pipette]
|
|
75
|
-
labware: Dict[str, Labware]
|
|
76
|
-
modules: Optional[Dict[str, Module]]
|
|
77
|
-
liquids: Optional[Dict[str, Liquid]]
|
|
78
|
-
labwareDefinitions: Dict[str, LabwareDefinition]
|
|
79
|
-
# commands must be after pipettes, labware, etc. for its @validator to work.
|
|
80
|
-
commands: List[Command]
|
|
81
|
-
commandAnnotations: Optional[List[CommandAnnotation]]
|
|
82
|
-
designerApplication: Optional[DesignerApplication]
|
|
83
|
-
|
|
84
|
-
class Config:
|
|
85
|
-
# added for constructing the class with field name instead of alias
|
|
86
|
-
allow_population_by_field_name = True
|
|
87
|
-
|
|
88
|
-
@validator("commands")
|
|
89
|
-
def _validate_commands(
|
|
90
|
-
cls,
|
|
91
|
-
value: List[Command],
|
|
92
|
-
values: Dict[str, Any],
|
|
93
|
-
) -> List[Command]:
|
|
94
|
-
pipette_ids = set(values["pipettes"].keys()) if "pipettes" in values else set()
|
|
95
|
-
labware_ids = set(values["labware"].keys()) if "labware" in values else set()
|
|
96
|
-
module_ids = (
|
|
97
|
-
set(values["modules"].keys())
|
|
98
|
-
if "modules" in values and values["modules"]
|
|
99
|
-
else set()
|
|
100
|
-
)
|
|
101
|
-
liquid_ids = (
|
|
102
|
-
set(values["liquids"].keys())
|
|
103
|
-
if "liquids" in values and values["liquids"]
|
|
104
|
-
else set()
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
for index, command in enumerate(value):
|
|
108
|
-
if (
|
|
109
|
-
command.params.pipetteId is not None
|
|
110
|
-
and command.params.pipetteId not in pipette_ids
|
|
111
|
-
):
|
|
112
|
-
raise ValueError(
|
|
113
|
-
f"{command.commandType} command at index {index}"
|
|
114
|
-
f" references ID {command.params.pipetteId},"
|
|
115
|
-
f" which doesn't exist."
|
|
116
|
-
)
|
|
117
|
-
if (
|
|
118
|
-
command.params.labwareId is not None
|
|
119
|
-
and command.params.labwareId not in labware_ids
|
|
120
|
-
):
|
|
121
|
-
raise ValueError(
|
|
122
|
-
f"{command.commandType} command at index {index}"
|
|
123
|
-
f" references ID {command.params.labwareId},"
|
|
124
|
-
f" which doesn't exist."
|
|
125
|
-
)
|
|
126
|
-
if (
|
|
127
|
-
command.params.moduleId is not None
|
|
128
|
-
and command.params.moduleId not in module_ids
|
|
129
|
-
):
|
|
130
|
-
raise ValueError(
|
|
131
|
-
f"{command.commandType} command at index {index}"
|
|
132
|
-
f" references ID {command.params.moduleId},"
|
|
133
|
-
f" which doesn't exist."
|
|
134
|
-
)
|
|
135
|
-
if (
|
|
136
|
-
command.params.liquidId is not None
|
|
137
|
-
and command.params.liquidId not in liquid_ids
|
|
138
|
-
):
|
|
139
|
-
raise ValueError(
|
|
140
|
-
f"{command.commandType} command at index {index}"
|
|
141
|
-
f" references ID {command.params.liquidId},"
|
|
142
|
-
f" which doesn't exist."
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
return value
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Any, List, Optional, Dict, Union
|
|
3
|
-
from typing_extensions import Literal
|
|
4
|
-
|
|
5
|
-
from opentrons_shared_data.labware.labware_definition import LabwareDefinition
|
|
6
|
-
|
|
7
|
-
from .shared_models import (
|
|
8
|
-
Liquid,
|
|
9
|
-
CommandAnnotation,
|
|
10
|
-
Location,
|
|
11
|
-
ProfileStep,
|
|
12
|
-
WellLocation,
|
|
13
|
-
OffsetVector,
|
|
14
|
-
Metadata,
|
|
15
|
-
Robot,
|
|
16
|
-
DesignerApplication,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# TODO (tamar 3/15/22): split apart all the command payloads when we tackle #9583
|
|
21
|
-
class Params(BaseModel):
|
|
22
|
-
slotName: Optional[str]
|
|
23
|
-
axes: Optional[List[str]]
|
|
24
|
-
pipetteId: Optional[str]
|
|
25
|
-
mount: Optional[str]
|
|
26
|
-
moduleId: Optional[str]
|
|
27
|
-
location: Optional[Union[Location, Literal["offDeck"]]]
|
|
28
|
-
labwareId: Optional[str]
|
|
29
|
-
displayName: Optional[str]
|
|
30
|
-
liquidId: Optional[str]
|
|
31
|
-
volumeByWell: Optional[Dict[str, Any]]
|
|
32
|
-
wellName: Optional[str]
|
|
33
|
-
volume: Optional[float]
|
|
34
|
-
flowRate: Optional[float]
|
|
35
|
-
wellLocation: Optional[WellLocation]
|
|
36
|
-
waitForResume: Optional[Literal[True]]
|
|
37
|
-
seconds: Optional[float]
|
|
38
|
-
minimumZHeight: Optional[float]
|
|
39
|
-
forceDirect: Optional[bool]
|
|
40
|
-
speed: Optional[float]
|
|
41
|
-
message: Optional[str]
|
|
42
|
-
coordinates: Optional[OffsetVector]
|
|
43
|
-
axis: Optional[str]
|
|
44
|
-
distance: Optional[float]
|
|
45
|
-
positionId: Optional[str]
|
|
46
|
-
temperature: Optional[float]
|
|
47
|
-
celsius: Optional[float]
|
|
48
|
-
blockMaxVolumeUl: Optional[float]
|
|
49
|
-
rpm: Optional[float]
|
|
50
|
-
height: Optional[float]
|
|
51
|
-
offset: Optional[OffsetVector]
|
|
52
|
-
profile: Optional[List[ProfileStep]]
|
|
53
|
-
radius: Optional[float]
|
|
54
|
-
# schema v7 add-ons
|
|
55
|
-
newLocation: Optional[Union[Location, Literal["offDeck"]]]
|
|
56
|
-
strategy: Optional[str]
|
|
57
|
-
pickUpOffset: Optional[OffsetVector]
|
|
58
|
-
dropOffset: Optional[OffsetVector]
|
|
59
|
-
homeAfter: Optional[bool]
|
|
60
|
-
alternateDropLocation: Optional[bool]
|
|
61
|
-
holdTimeSeconds: Optional[float]
|
|
62
|
-
maintenancePosition: Optional[str]
|
|
63
|
-
pipetteName: Optional[str]
|
|
64
|
-
model: Optional[str]
|
|
65
|
-
loadName: Optional[str]
|
|
66
|
-
namespace: Optional[str]
|
|
67
|
-
version: Optional[int]
|
|
68
|
-
pushOut: Optional[float]
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class Command(BaseModel):
|
|
72
|
-
commandType: str
|
|
73
|
-
params: Params
|
|
74
|
-
key: Optional[str]
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class ProtocolSchemaV7(BaseModel):
|
|
78
|
-
otSharedSchema: Literal["#/protocol/schemas/7"] = Field(
|
|
79
|
-
...,
|
|
80
|
-
alias="$otSharedSchema",
|
|
81
|
-
description="The path to a valid Opentrons shared schema relative to "
|
|
82
|
-
"the shared-data directory, without its extension.",
|
|
83
|
-
)
|
|
84
|
-
schemaVersion: Literal[7]
|
|
85
|
-
metadata: Metadata
|
|
86
|
-
robot: Robot
|
|
87
|
-
liquids: Optional[Dict[str, Liquid]]
|
|
88
|
-
labwareDefinitions: Dict[str, LabwareDefinition]
|
|
89
|
-
commands: List[Command]
|
|
90
|
-
commandAnnotations: Optional[List[CommandAnnotation]]
|
|
91
|
-
designerApplication: Optional[DesignerApplication]
|
|
92
|
-
|
|
93
|
-
class Config:
|
|
94
|
-
# added for constructing the class with field name instead of alias
|
|
95
|
-
allow_population_by_field_name = True
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field, Extra
|
|
2
|
-
from typing import Any, List, Optional, Dict, Union
|
|
3
|
-
from typing_extensions import Literal
|
|
4
|
-
|
|
5
|
-
from opentrons_shared_data.labware.labware_definition import LabwareDefinition
|
|
6
|
-
|
|
7
|
-
from .shared_models import (
|
|
8
|
-
Liquid,
|
|
9
|
-
Location,
|
|
10
|
-
ProfileStep,
|
|
11
|
-
WellLocation,
|
|
12
|
-
OffsetVector,
|
|
13
|
-
Metadata,
|
|
14
|
-
DesignerApplication,
|
|
15
|
-
Robot,
|
|
16
|
-
NozzleConfigurationParams,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# TODO (tamar 3/15/22): split apart all the command payloads when we tackle #9583
|
|
21
|
-
class Params(BaseModel):
|
|
22
|
-
slotName: Optional[str]
|
|
23
|
-
axes: Optional[List[str]]
|
|
24
|
-
pipetteId: Optional[str]
|
|
25
|
-
mount: Optional[str]
|
|
26
|
-
moduleId: Optional[str]
|
|
27
|
-
location: Optional[Union[Location, Literal["offDeck"]]]
|
|
28
|
-
labwareId: Optional[str]
|
|
29
|
-
displayName: Optional[str]
|
|
30
|
-
liquidId: Optional[str]
|
|
31
|
-
volumeByWell: Optional[Dict[str, Any]]
|
|
32
|
-
wellName: Optional[str]
|
|
33
|
-
volume: Optional[float]
|
|
34
|
-
flowRate: Optional[float]
|
|
35
|
-
wellLocation: Optional[WellLocation]
|
|
36
|
-
waitForResume: Optional[Literal[True]]
|
|
37
|
-
seconds: Optional[float]
|
|
38
|
-
minimumZHeight: Optional[float]
|
|
39
|
-
forceDirect: Optional[bool]
|
|
40
|
-
speed: Optional[float]
|
|
41
|
-
message: Optional[str]
|
|
42
|
-
coordinates: Optional[OffsetVector]
|
|
43
|
-
axis: Optional[str]
|
|
44
|
-
distance: Optional[float]
|
|
45
|
-
positionId: Optional[str]
|
|
46
|
-
temperature: Optional[float]
|
|
47
|
-
celsius: Optional[float]
|
|
48
|
-
blockMaxVolumeUl: Optional[float]
|
|
49
|
-
rpm: Optional[float]
|
|
50
|
-
height: Optional[float]
|
|
51
|
-
offset: Optional[OffsetVector]
|
|
52
|
-
profile: Optional[List[ProfileStep]]
|
|
53
|
-
radius: Optional[float]
|
|
54
|
-
newLocation: Optional[Union[Location, Literal["offDeck"]]]
|
|
55
|
-
strategy: Optional[str]
|
|
56
|
-
# schema v7 add-ons
|
|
57
|
-
homeAfter: Optional[bool]
|
|
58
|
-
alternateDropLocation: Optional[bool]
|
|
59
|
-
holdTimeSeconds: Optional[float]
|
|
60
|
-
maintenancePosition: Optional[str]
|
|
61
|
-
pipetteName: Optional[str]
|
|
62
|
-
model: Optional[str]
|
|
63
|
-
loadName: Optional[str]
|
|
64
|
-
namespace: Optional[str]
|
|
65
|
-
version: Optional[int]
|
|
66
|
-
pushOut: Optional[float]
|
|
67
|
-
pickUpOffset: Optional[OffsetVector]
|
|
68
|
-
dropOffset: Optional[OffsetVector]
|
|
69
|
-
# schema v8 add-ons
|
|
70
|
-
addressableAreaName: Optional[str]
|
|
71
|
-
configurationParams: Optional[NozzleConfigurationParams]
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class Command(BaseModel):
|
|
75
|
-
commandType: str
|
|
76
|
-
params: Params
|
|
77
|
-
key: Optional[str]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class CommandAnnotation(BaseModel):
|
|
81
|
-
commandKeys: List[str]
|
|
82
|
-
annotationType: str
|
|
83
|
-
|
|
84
|
-
class Config:
|
|
85
|
-
extra = Extra.allow
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class ProtocolSchemaV8(BaseModel):
|
|
89
|
-
otSharedSchema: Literal["#/protocol/schemas/8"] = Field(
|
|
90
|
-
...,
|
|
91
|
-
alias="$otSharedSchema",
|
|
92
|
-
description="The path to a valid Opentrons shared schema relative to "
|
|
93
|
-
"the shared-data directory, without its extension.",
|
|
94
|
-
)
|
|
95
|
-
schemaVersion: Literal[8]
|
|
96
|
-
metadata: Metadata
|
|
97
|
-
robot: Robot
|
|
98
|
-
liquidSchemaId: Literal["opentronsLiquidSchemaV1"]
|
|
99
|
-
liquids: Dict[str, Liquid]
|
|
100
|
-
labwareDefinitionSchemaId: Literal["opentronsLabwareSchemaV2"]
|
|
101
|
-
labwareDefinitions: Dict[str, LabwareDefinition]
|
|
102
|
-
commandSchemaId: Literal["opentronsCommandSchemaV8"]
|
|
103
|
-
commands: List[Command]
|
|
104
|
-
commandAnnotationSchemaId: Literal["opentronsCommandAnnotationSchemaV1"]
|
|
105
|
-
commandAnnotations: List[CommandAnnotation]
|
|
106
|
-
designerApplication: Optional[DesignerApplication]
|
|
107
|
-
|
|
108
|
-
class Config:
|
|
109
|
-
# added for constructing the class with field name instead of alias
|
|
110
|
-
allow_population_by_field_name = True
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
from typing import Optional, List, Dict, Any
|
|
2
|
-
from typing_extensions import Literal
|
|
3
|
-
from enum import Enum
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Dimensions(BaseModel):
|
|
8
|
-
xDimension: float
|
|
9
|
-
yDimension: float
|
|
10
|
-
zDimension: float
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class GroupMetadata(BaseModel):
|
|
14
|
-
pass
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class Group(BaseModel):
|
|
18
|
-
metadata: GroupMetadata
|
|
19
|
-
wells: List[str]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class Shape(Enum):
|
|
23
|
-
circular = "circular"
|
|
24
|
-
rectangular = "rectangular"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class WellDefinition(BaseModel):
|
|
28
|
-
depth: float
|
|
29
|
-
totalLiquidVolume: int
|
|
30
|
-
shape: Shape
|
|
31
|
-
x: float
|
|
32
|
-
y: float
|
|
33
|
-
z: float
|
|
34
|
-
diameter: Optional[float]
|
|
35
|
-
yDimension: Optional[float]
|
|
36
|
-
xDimension: Optional[float]
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class Metadata(BaseModel):
|
|
40
|
-
protocolName: Optional[str]
|
|
41
|
-
author: Optional[str]
|
|
42
|
-
description: Optional[str]
|
|
43
|
-
created: Optional[int]
|
|
44
|
-
lastModified: Optional[int]
|
|
45
|
-
category: Optional[str]
|
|
46
|
-
subcategory: Optional[str]
|
|
47
|
-
tags: Optional[List[str]]
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class Module(BaseModel):
|
|
51
|
-
model: str
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class Pipette(BaseModel):
|
|
55
|
-
name: str
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class Robot(BaseModel):
|
|
59
|
-
model: Literal["OT-2 Standard", "OT-3 Standard"]
|
|
60
|
-
deckId: str
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class DesignerApplication(BaseModel):
|
|
64
|
-
name: Optional[str]
|
|
65
|
-
version: Optional[str]
|
|
66
|
-
data: Optional[Dict[str, Any]]
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class CommandAnnotation(BaseModel):
|
|
70
|
-
commandIds: List[str]
|
|
71
|
-
annotationType: str
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class OffsetVector(BaseModel):
|
|
75
|
-
x: Optional[float]
|
|
76
|
-
y: Optional[float]
|
|
77
|
-
z: Optional[float]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class Location(BaseModel):
|
|
81
|
-
slotName: Optional[str]
|
|
82
|
-
moduleId: Optional[str]
|
|
83
|
-
labwareId: Optional[str]
|
|
84
|
-
addressableAreaName: Optional[str]
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class ProfileStep(BaseModel):
|
|
88
|
-
celsius: float
|
|
89
|
-
holdSeconds: float
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class WellLocation(BaseModel):
|
|
93
|
-
origin: Optional[str]
|
|
94
|
-
offset: Optional[OffsetVector]
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class Liquid(BaseModel):
|
|
98
|
-
displayName: str
|
|
99
|
-
description: str
|
|
100
|
-
displayColor: Optional[str]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class Labware(BaseModel):
|
|
104
|
-
displayName: Optional[str]
|
|
105
|
-
definitionId: str
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class NozzleConfigurationParams(BaseModel):
|
|
109
|
-
style: str
|
|
110
|
-
primaryNozzle: Optional[str]
|
|
111
|
-
frontRightNozzle: Optional[str]
|
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"""opentrons_shared_data.robot: Submodule for handling robot definition data."""
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import cast
|
|
4
|
-
from typing_extensions import Final
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
|
|
8
|
-
from .. import get_shared_data_root
|
|
9
|
-
|
|
10
|
-
from .dev_types import RobotDefinition, RobotType
|
|
11
|
-
|
|
12
|
-
DEFAULT_ROBOT_DEFINITION_VERSION: Final = 1
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def load(
|
|
16
|
-
robot_type: RobotType, version: int = DEFAULT_ROBOT_DEFINITION_VERSION
|
|
17
|
-
) -> RobotDefinition:
|
|
18
|
-
"""Load the definition for the specified robot id."""
|
|
19
|
-
for fi in Path(
|
|
20
|
-
get_shared_data_root() / "robot" / "definitions" / f"{version}"
|
|
21
|
-
).iterdir():
|
|
22
|
-
defn = json.load(fi.open("r"))
|
|
23
|
-
if defn["robotType"] == robot_type:
|
|
24
|
-
return cast(RobotDefinition, defn)
|
|
25
|
-
raise KeyError(robot_type)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def user_facing_robot_type(robot_type: RobotType, include_article: bool = False) -> str:
|
|
29
|
-
"""Appropriately formatted robot type string for use in user-facing messages."""
|
|
30
|
-
if robot_type == "OT-2 Standard":
|
|
31
|
-
return "an OT-2" if include_article else "OT-2"
|
|
32
|
-
elif robot_type == "OT-3 Standard":
|
|
33
|
-
return "a Flex" if include_article else "Flex"
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"""opentrons_shared_data.robot.dev_types: types for robot def."""
|
|
2
|
-
import enum
|
|
3
|
-
from typing import NewType, List, Dict, Any
|
|
4
|
-
from typing_extensions import Literal, TypedDict
|
|
5
|
-
|
|
6
|
-
RobotSchemaVersion1 = Literal[1]
|
|
7
|
-
|
|
8
|
-
RobotSchema = NewType("RobotSchema", Dict[str, Any])
|
|
9
|
-
|
|
10
|
-
RobotType = Literal["OT-2 Standard", "OT-3 Standard"]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class RobotTypeEnum(enum.Enum):
|
|
14
|
-
"""An enum representing the active robot type."""
|
|
15
|
-
|
|
16
|
-
# TODO we should switch over to using Enums fully (if possible)
|
|
17
|
-
# to represent our robot types in code -- rather than having
|
|
18
|
-
# to string match everywhere.
|
|
19
|
-
OT2 = enum.auto()
|
|
20
|
-
FLEX = enum.auto()
|
|
21
|
-
|
|
22
|
-
@classmethod
|
|
23
|
-
def robot_literal_to_enum(cls, robot_type: RobotType) -> "RobotTypeEnum":
|
|
24
|
-
"""Convert Robot Type Literal to Robot Type Enum."""
|
|
25
|
-
if robot_type == "OT-2 Standard":
|
|
26
|
-
return cls.OT2
|
|
27
|
-
elif robot_type == "OT-3 Standard":
|
|
28
|
-
return cls.FLEX
|
|
29
|
-
# No final `else` statement, depend on mypy exhaustiveness checking
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class RobotDefinition(TypedDict):
|
|
33
|
-
"""A python version of the robot definition type."""
|
|
34
|
-
|
|
35
|
-
displayName: str
|
|
36
|
-
robotType: RobotType
|
|
37
|
-
models: List[str]
|
package/python/pytest.ini
DELETED