@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,63 +0,0 @@
|
|
|
1
|
-
"""opentrons_shared_data.gripper: functions and types for gripper config."""
|
|
2
|
-
from typing import cast, Any
|
|
3
|
-
from typing_extensions import Literal
|
|
4
|
-
import json
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
from .. import load_shared_data
|
|
8
|
-
from .gripper_definition import (
|
|
9
|
-
GripperDefinition,
|
|
10
|
-
GripperSchema,
|
|
11
|
-
GripperSchemaVersion,
|
|
12
|
-
GripForceProfile,
|
|
13
|
-
GripperModel,
|
|
14
|
-
Geometry,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class InvalidGripperDefinition(Exception):
|
|
19
|
-
"""Incorrect gripper definition."""
|
|
20
|
-
|
|
21
|
-
pass
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def generate_schema() -> str:
|
|
25
|
-
"""Create schema."""
|
|
26
|
-
raw_json_schema = GripperDefinition.schema_json()
|
|
27
|
-
schema_as_dict = json.loads(raw_json_schema)
|
|
28
|
-
return json.dumps(schema_as_dict, indent=2)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def load_schema(version: Literal[1]) -> GripperSchema:
|
|
32
|
-
"""Load gripper schema."""
|
|
33
|
-
path = Path("gripper") / "schemas" / f"{version}.json"
|
|
34
|
-
return cast(GripperSchema, json.loads(load_shared_data(path)))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def _load_definition_data(path: Path) -> Any:
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def load_definition(
|
|
42
|
-
model: GripperModel,
|
|
43
|
-
version: GripperSchemaVersion = 1,
|
|
44
|
-
) -> GripperDefinition:
|
|
45
|
-
"""Load gripper definition based on schema version and gripper model."""
|
|
46
|
-
try:
|
|
47
|
-
path = Path("gripper") / "definitions" / f"{version}" / f"{model.value}.json"
|
|
48
|
-
return GripperDefinition.parse_obj(json.loads(load_shared_data(path)))
|
|
49
|
-
except FileNotFoundError:
|
|
50
|
-
raise InvalidGripperDefinition(
|
|
51
|
-
f"Gripper model {model} definition in schema version {version} does not exist."
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
__all__ = [
|
|
56
|
-
"GripperDefinition",
|
|
57
|
-
"GripperSchema",
|
|
58
|
-
"GripperSchemaVersion",
|
|
59
|
-
"GripForceProfile",
|
|
60
|
-
"GripperModel",
|
|
61
|
-
"Geometry",
|
|
62
|
-
"generate_schema",
|
|
63
|
-
]
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"""Gripper configurations."""
|
|
2
|
-
|
|
3
|
-
from typing_extensions import Literal
|
|
4
|
-
from typing import TYPE_CHECKING, List, Dict, Tuple, Any, NewType
|
|
5
|
-
from pydantic import BaseModel, Field, conint, confloat
|
|
6
|
-
from enum import Enum
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def _snake_to_camel_case(snake: str) -> str:
|
|
10
|
-
"""Turns snake_case to camelCase."""
|
|
11
|
-
return "".join(
|
|
12
|
-
[s.capitalize() if i > 0 else s.lower() for i, s in enumerate(snake.split("_"))]
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
GripperModelStr = NewType("GripperModelStr", str)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# TODO (spp, 2023-01-31): figure out if we want to keep this a string enum or revert to
|
|
20
|
-
# a regular enum with custom stringification
|
|
21
|
-
class GripperModel(str, Enum):
|
|
22
|
-
"""Gripper models."""
|
|
23
|
-
|
|
24
|
-
v1 = "gripperV1"
|
|
25
|
-
v1_1 = "gripperV1.1"
|
|
26
|
-
v1_2 = "gripperV1.2"
|
|
27
|
-
|
|
28
|
-
def __str__(self) -> str:
|
|
29
|
-
"""Model name."""
|
|
30
|
-
enum_to_str = {
|
|
31
|
-
self.__class__.v1: "gripperV1",
|
|
32
|
-
self.__class__.v1_1: "gripperV1.1",
|
|
33
|
-
self.__class__.v1_2: "gripperV1.2",
|
|
34
|
-
}
|
|
35
|
-
return enum_to_str[self]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
GripperSchemaVersion = Literal[1]
|
|
39
|
-
|
|
40
|
-
GripperSchema = Dict[str, Any]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if TYPE_CHECKING:
|
|
44
|
-
_StrictNonNegativeInt = int
|
|
45
|
-
_StrictNonNegativeFloat = float
|
|
46
|
-
else:
|
|
47
|
-
_StrictNonNegativeInt = conint(strict=True, ge=0)
|
|
48
|
-
_StrictNonNegativeFloat = confloat(strict=True, ge=0.0)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class GripperBaseModel(BaseModel):
|
|
52
|
-
"""Gripper base model."""
|
|
53
|
-
|
|
54
|
-
class Config:
|
|
55
|
-
"""Config."""
|
|
56
|
-
|
|
57
|
-
alias_generator = _snake_to_camel_case
|
|
58
|
-
allow_population_by_field_name = True
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Offset = Tuple[float, float, float]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class Geometry(GripperBaseModel):
|
|
65
|
-
"""Gripper geometry definition."""
|
|
66
|
-
|
|
67
|
-
base_offset_from_mount: Offset
|
|
68
|
-
jaw_center_offset_from_base: Offset
|
|
69
|
-
pin_one_offset_from_base: Offset
|
|
70
|
-
pin_two_offset_from_base: Offset
|
|
71
|
-
jaw_width: Dict[str, float]
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
PolynomialTerm = Tuple[_StrictNonNegativeInt, float]
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class GripForceProfile(GripperBaseModel):
|
|
78
|
-
"""Gripper force profile."""
|
|
79
|
-
|
|
80
|
-
polynomial: List[PolynomialTerm] = Field(
|
|
81
|
-
...,
|
|
82
|
-
description="Polynomial function to convert a grip force in Newton to the jaw motor duty cycle value, which will be read by the gripper firmware.",
|
|
83
|
-
min_items=1,
|
|
84
|
-
)
|
|
85
|
-
default_grip_force: _StrictNonNegativeFloat
|
|
86
|
-
default_idle_force: _StrictNonNegativeFloat
|
|
87
|
-
default_home_force: _StrictNonNegativeFloat
|
|
88
|
-
min: _StrictNonNegativeFloat
|
|
89
|
-
max: _StrictNonNegativeFloat
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class GripperDefinition(GripperBaseModel):
|
|
93
|
-
"""Gripper definition."""
|
|
94
|
-
|
|
95
|
-
schema_version: GripperSchemaVersion = Field(
|
|
96
|
-
..., description="Which schema version a gripper is using"
|
|
97
|
-
)
|
|
98
|
-
display_name: str = Field(..., description="Gripper display name.")
|
|
99
|
-
model: GripperModel
|
|
100
|
-
geometry: Geometry
|
|
101
|
-
grip_force_profile: GripForceProfile
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
opentrons_shared_data.labware: types and functions for accessing labware defs
|
|
3
|
-
"""
|
|
4
|
-
import json
|
|
5
|
-
from typing import Any, Dict, NewType, TYPE_CHECKING
|
|
6
|
-
|
|
7
|
-
from .. import load_shared_data
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from .dev_types import LabwareDefinition
|
|
11
|
-
|
|
12
|
-
Schema = NewType("Schema", Dict[str, Any])
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def load_definition(loadname: str, version: int) -> "LabwareDefinition":
|
|
16
|
-
return json.loads(
|
|
17
|
-
load_shared_data(f"labware/definitions/2/{loadname}/{version}.json")
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def load_schema() -> Schema:
|
|
22
|
-
return json.loads(load_shared_data("labware/schemas/2.json"))
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
""" opentrons_shared_data.labware.dev_types: types for labware defs
|
|
2
|
-
|
|
3
|
-
types in this file by and large require the use of typing_extensions.
|
|
4
|
-
this module shouldn't be imported unless typing.TYPE_CHECKING is true.
|
|
5
|
-
"""
|
|
6
|
-
from typing import Dict, List, NewType, Union
|
|
7
|
-
from typing_extensions import Literal, TypedDict
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
LabwareUri = NewType("LabwareUri", str)
|
|
11
|
-
|
|
12
|
-
LabwareDisplayCategory = Union[
|
|
13
|
-
Literal["tipRack"],
|
|
14
|
-
Literal["tubeRack"],
|
|
15
|
-
Literal["reservoir"],
|
|
16
|
-
Literal["trash"],
|
|
17
|
-
Literal["wellPlate"],
|
|
18
|
-
Literal["aluminumBlock"],
|
|
19
|
-
Literal["adapter"],
|
|
20
|
-
Literal["other"],
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
LabwareFormat = Union[
|
|
24
|
-
Literal["96Standard"],
|
|
25
|
-
Literal["384Standard"],
|
|
26
|
-
Literal["trough"],
|
|
27
|
-
Literal["irregular"],
|
|
28
|
-
Literal["trash"],
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
LabwareRoles = Union[
|
|
32
|
-
Literal["labware"],
|
|
33
|
-
Literal["fixture"],
|
|
34
|
-
Literal["adapter"],
|
|
35
|
-
Literal["maintenance"],
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
Circular = Literal["circular"]
|
|
39
|
-
Rectangular = Literal["rectangular"]
|
|
40
|
-
WellShape = Union[Circular, Rectangular]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class NamedOffset(TypedDict):
|
|
44
|
-
x: float
|
|
45
|
-
y: float
|
|
46
|
-
z: float
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class GripperOffsets(TypedDict):
|
|
50
|
-
pickUpOffset: NamedOffset
|
|
51
|
-
dropOffset: NamedOffset
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class LabwareParameters(TypedDict, total=False):
|
|
55
|
-
format: LabwareFormat
|
|
56
|
-
isTiprack: bool
|
|
57
|
-
loadName: str
|
|
58
|
-
isMagneticModuleCompatible: bool
|
|
59
|
-
quirks: List[str]
|
|
60
|
-
tipLength: float
|
|
61
|
-
tipOverlap: float
|
|
62
|
-
magneticModuleEngageHeight: float
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class LabwareBrandData(TypedDict, total=False):
|
|
66
|
-
brand: str
|
|
67
|
-
brandId: List[str]
|
|
68
|
-
links: List[str]
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class LabwareMetadata(TypedDict, total=False):
|
|
72
|
-
displayName: str
|
|
73
|
-
displayCategory: LabwareDisplayCategory
|
|
74
|
-
displayVolumeUnits: Union[Literal["µL"], Literal["mL"], Literal["L"]]
|
|
75
|
-
tags: List[str]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class LabwareDimensions(TypedDict):
|
|
79
|
-
yDimension: float
|
|
80
|
-
zDimension: float
|
|
81
|
-
xDimension: float
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class CircularWellDefinition(TypedDict):
|
|
85
|
-
shape: Circular
|
|
86
|
-
depth: float
|
|
87
|
-
totalLiquidVolume: float
|
|
88
|
-
x: float
|
|
89
|
-
y: float
|
|
90
|
-
z: float
|
|
91
|
-
diameter: float
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class RectangularWellDefinition(TypedDict):
|
|
95
|
-
shape: Rectangular
|
|
96
|
-
depth: float
|
|
97
|
-
totalLiquidVolume: float
|
|
98
|
-
x: float
|
|
99
|
-
y: float
|
|
100
|
-
z: float
|
|
101
|
-
xDimension: float
|
|
102
|
-
yDimension: float
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
WellDefinition = Union[CircularWellDefinition, RectangularWellDefinition]
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class WellGroupMetadata(TypedDict, total=False):
|
|
109
|
-
displayName: str
|
|
110
|
-
displayCategory: LabwareDisplayCategory
|
|
111
|
-
wellBottomShape: Union[Literal["flat"], Literal["u"], Literal["v"]]
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class WellGroup(TypedDict, total=False):
|
|
115
|
-
wells: List[str]
|
|
116
|
-
metadata: WellGroupMetadata
|
|
117
|
-
brand: LabwareBrandData
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class _RequiredLabwareDefinition(TypedDict):
|
|
121
|
-
schemaVersion: Literal[2]
|
|
122
|
-
version: int
|
|
123
|
-
namespace: str
|
|
124
|
-
metadata: LabwareMetadata
|
|
125
|
-
brand: LabwareBrandData
|
|
126
|
-
parameters: LabwareParameters
|
|
127
|
-
cornerOffsetFromSlot: NamedOffset
|
|
128
|
-
ordering: List[List[str]]
|
|
129
|
-
dimensions: LabwareDimensions
|
|
130
|
-
wells: Dict[str, WellDefinition]
|
|
131
|
-
groups: List[WellGroup]
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
class LabwareDefinition(_RequiredLabwareDefinition, total=False):
|
|
135
|
-
stackingOffsetWithLabware: Dict[str, NamedOffset]
|
|
136
|
-
stackingOffsetWithModule: Dict[str, NamedOffset]
|
|
137
|
-
allowedRoles: List[LabwareRoles]
|
|
138
|
-
gripperOffsets: Dict[str, GripperOffsets]
|
|
139
|
-
gripForce: float
|
|
140
|
-
gripHeightFromLabwareBottom: float
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This was initially generated by datamodel-codegen from the labware schema in
|
|
3
|
-
shared-data. It's been modified by hand to be more friendly.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from __future__ import annotations
|
|
7
|
-
|
|
8
|
-
from enum import Enum
|
|
9
|
-
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
|
10
|
-
|
|
11
|
-
from pydantic import (
|
|
12
|
-
BaseModel,
|
|
13
|
-
Extra,
|
|
14
|
-
Field,
|
|
15
|
-
conint,
|
|
16
|
-
confloat,
|
|
17
|
-
StrictInt,
|
|
18
|
-
StrictFloat,
|
|
19
|
-
)
|
|
20
|
-
from typing_extensions import Literal
|
|
21
|
-
|
|
22
|
-
SAFE_STRING_REGEX = "^[a-z0-9._]+$"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if TYPE_CHECKING:
|
|
26
|
-
_StrictNonNegativeInt = int
|
|
27
|
-
_StrictNonNegativeFloat = float
|
|
28
|
-
else:
|
|
29
|
-
_StrictNonNegativeInt = conint(strict=True, ge=0)
|
|
30
|
-
_StrictNonNegativeFloat = confloat(strict=True, ge=0.0)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_Number = Union[StrictInt, StrictFloat]
|
|
34
|
-
"""JSON number type, written to preserve lack of decimal point.
|
|
35
|
-
|
|
36
|
-
For labware definition hashing, which is an older part of the codebase,
|
|
37
|
-
this ensures that Pydantic won't change `"someFloatField: 0` to
|
|
38
|
-
`"someFloatField": 0.0`, which would hash differently.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
_NonNegativeNumber = Union[_StrictNonNegativeInt, _StrictNonNegativeFloat]
|
|
42
|
-
"""Non-negative JSON number type, written to preserve lack of decimal point."""
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class CornerOffsetFromSlot(BaseModel):
|
|
46
|
-
"""
|
|
47
|
-
Distance from left-front-bottom corner of slot to left-front-bottom corner
|
|
48
|
-
of labware bounding box. Used for labware that spans multiple slots. For
|
|
49
|
-
labware that does not span multiple slots, x/y/z should all be zero.
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
x: _Number
|
|
53
|
-
y: _Number
|
|
54
|
-
z: _Number
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class OverlapOffset(BaseModel):
|
|
58
|
-
"""
|
|
59
|
-
Overlap dimensions of labware with another labware/module that it can be stacked on top of.
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
x: _Number
|
|
63
|
-
y: _Number
|
|
64
|
-
z: _Number
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class OffsetVector(BaseModel):
|
|
68
|
-
"""
|
|
69
|
-
A generic 3-D offset vector.
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
|
-
x: _Number
|
|
73
|
-
y: _Number
|
|
74
|
-
z: _Number
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class GripperOffsets(BaseModel):
|
|
78
|
-
"""
|
|
79
|
-
Offsets used when calculating coordinates for gripping labware during labware movement.
|
|
80
|
-
"""
|
|
81
|
-
|
|
82
|
-
pickUpOffset: OffsetVector
|
|
83
|
-
dropOffset: OffsetVector
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class BrandData(BaseModel):
|
|
87
|
-
brand: str = Field(..., description="Brand/manufacturer name")
|
|
88
|
-
brandId: Optional[List[str]] = Field(
|
|
89
|
-
None,
|
|
90
|
-
description="An array of manufacture numbers pertaining to a given labware",
|
|
91
|
-
)
|
|
92
|
-
links: Optional[List[str]] = Field(
|
|
93
|
-
None, description="URLs for manufacturer page(s)"
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class DisplayCategory(str, Enum):
|
|
98
|
-
tipRack = "tipRack"
|
|
99
|
-
tubeRack = "tubeRack"
|
|
100
|
-
reservoir = "reservoir"
|
|
101
|
-
trash = "trash"
|
|
102
|
-
wellPlate = "wellPlate"
|
|
103
|
-
aluminumBlock = "aluminumBlock"
|
|
104
|
-
adapter = "adapter"
|
|
105
|
-
other = "other"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class LabwareRole(str, Enum):
|
|
109
|
-
labware = "labware"
|
|
110
|
-
fixture = "fixture"
|
|
111
|
-
adapter = "adapter"
|
|
112
|
-
maintenance = "maintenance"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class Metadata(BaseModel):
|
|
116
|
-
"""
|
|
117
|
-
Properties used for search and display
|
|
118
|
-
"""
|
|
119
|
-
|
|
120
|
-
displayName: str = Field(..., description="Easy to remember name of labware")
|
|
121
|
-
displayCategory: DisplayCategory = Field(
|
|
122
|
-
..., description="Label(s) used in UI to categorize labware"
|
|
123
|
-
)
|
|
124
|
-
displayVolumeUnits: Literal["µL", "mL", "L"] = Field(
|
|
125
|
-
..., description="Volume units for display"
|
|
126
|
-
)
|
|
127
|
-
tags: Optional[List[str]] = Field(
|
|
128
|
-
None, description="List of descriptions for a given labware"
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
class Parameters(BaseModel):
|
|
133
|
-
"""
|
|
134
|
-
Internal describers used to determine pipette movement to labware
|
|
135
|
-
"""
|
|
136
|
-
|
|
137
|
-
format: Literal[
|
|
138
|
-
"96Standard", "384Standard", "trough", "irregular", "trash"
|
|
139
|
-
] = Field(
|
|
140
|
-
..., description="Property to determine compatibility with multichannel pipette"
|
|
141
|
-
)
|
|
142
|
-
quirks: Optional[List[str]] = Field(
|
|
143
|
-
None,
|
|
144
|
-
description="Property to classify a specific behavior this labware "
|
|
145
|
-
"should have",
|
|
146
|
-
)
|
|
147
|
-
isTiprack: bool = Field(
|
|
148
|
-
..., description="Flag marking whether a labware is a tiprack or not"
|
|
149
|
-
)
|
|
150
|
-
tipLength: Optional[_NonNegativeNumber] = Field(
|
|
151
|
-
None,
|
|
152
|
-
description="Required if labware is tiprack, specifies length of tip"
|
|
153
|
-
" from drawing or as measured with calipers",
|
|
154
|
-
)
|
|
155
|
-
tipOverlap: Optional[_NonNegativeNumber] = Field(
|
|
156
|
-
None,
|
|
157
|
-
description="Required if labware is tiprack, specifies the length of "
|
|
158
|
-
"the area of the tip that overlaps the nozzle of the pipette",
|
|
159
|
-
)
|
|
160
|
-
loadName: str = Field(
|
|
161
|
-
...,
|
|
162
|
-
description="Name used to reference a labware definition",
|
|
163
|
-
regex=SAFE_STRING_REGEX,
|
|
164
|
-
)
|
|
165
|
-
isMagneticModuleCompatible: bool = Field(
|
|
166
|
-
...,
|
|
167
|
-
description="Flag marking whether a labware is compatible by default "
|
|
168
|
-
"with the Magnetic Module",
|
|
169
|
-
)
|
|
170
|
-
magneticModuleEngageHeight: Optional[_NonNegativeNumber] = Field(
|
|
171
|
-
None, description="Distance to move magnetic module magnets to engage"
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
class Dimensions(BaseModel):
|
|
176
|
-
"""
|
|
177
|
-
Outer dimensions of a labware
|
|
178
|
-
"""
|
|
179
|
-
|
|
180
|
-
yDimension: _NonNegativeNumber = Field(...)
|
|
181
|
-
zDimension: _NonNegativeNumber = Field(...)
|
|
182
|
-
xDimension: _NonNegativeNumber = Field(...)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
class WellDefinition(BaseModel):
|
|
186
|
-
class Config:
|
|
187
|
-
extra = Extra.allow
|
|
188
|
-
|
|
189
|
-
depth: _NonNegativeNumber = Field(...)
|
|
190
|
-
x: _NonNegativeNumber = Field(
|
|
191
|
-
...,
|
|
192
|
-
description="x location of center-bottom of well in reference to "
|
|
193
|
-
"left-front-bottom of labware",
|
|
194
|
-
)
|
|
195
|
-
y: _NonNegativeNumber = Field(
|
|
196
|
-
...,
|
|
197
|
-
description="y location of center-bottom of well in reference to "
|
|
198
|
-
"left-front-bottom of labware",
|
|
199
|
-
)
|
|
200
|
-
z: _NonNegativeNumber = Field(
|
|
201
|
-
...,
|
|
202
|
-
description="z location of center-bottom of well in reference to "
|
|
203
|
-
"left-front-bottom of labware",
|
|
204
|
-
)
|
|
205
|
-
totalLiquidVolume: _NonNegativeNumber = Field(
|
|
206
|
-
..., description="Total well, tube, or tip volume in microliters"
|
|
207
|
-
)
|
|
208
|
-
xDimension: Optional[_NonNegativeNumber] = Field(
|
|
209
|
-
None,
|
|
210
|
-
description="x dimension of rectangular wells",
|
|
211
|
-
)
|
|
212
|
-
yDimension: Optional[_NonNegativeNumber] = Field(
|
|
213
|
-
None,
|
|
214
|
-
description="y dimension of rectangular wells",
|
|
215
|
-
)
|
|
216
|
-
diameter: Optional[_NonNegativeNumber] = Field(
|
|
217
|
-
None,
|
|
218
|
-
description="diameter of circular wells",
|
|
219
|
-
)
|
|
220
|
-
shape: Literal["rectangular", "circular"] = Field(
|
|
221
|
-
...,
|
|
222
|
-
description="If 'rectangular', use xDimension and "
|
|
223
|
-
"yDimension; if 'circular' use diameter",
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
class Metadata1(BaseModel):
|
|
228
|
-
"""
|
|
229
|
-
Metadata specific to a grid of wells in a labware
|
|
230
|
-
"""
|
|
231
|
-
|
|
232
|
-
displayName: Optional[str] = Field(
|
|
233
|
-
None, description="User-readable name for the well group"
|
|
234
|
-
)
|
|
235
|
-
displayCategory: Optional[DisplayCategory] = Field(
|
|
236
|
-
None, description="Label(s) used in UI to categorize well groups"
|
|
237
|
-
)
|
|
238
|
-
wellBottomShape: Optional[Literal["flat", "u", "v"]] = Field(
|
|
239
|
-
None, description="Bottom shape of the well for UI purposes"
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
class Group(BaseModel):
|
|
244
|
-
wells: List[str] = Field(
|
|
245
|
-
..., description="An array of wells that contain the same metadata"
|
|
246
|
-
)
|
|
247
|
-
metadata: Metadata1 = Field(
|
|
248
|
-
..., description="Metadata specific to a grid of wells in a labware"
|
|
249
|
-
)
|
|
250
|
-
brand: Optional[BrandData] = Field(
|
|
251
|
-
None, description="Brand data for the well group (e.g. for tubes)"
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
class LabwareDefinition(BaseModel):
|
|
256
|
-
schemaVersion: Literal[1, 2] = Field(
|
|
257
|
-
..., description="Which schema version a labware is using"
|
|
258
|
-
)
|
|
259
|
-
version: int = Field(
|
|
260
|
-
...,
|
|
261
|
-
description="Version of the labware definition itself "
|
|
262
|
-
"(eg myPlate v1/v2/v3). An incrementing integer",
|
|
263
|
-
ge=1.0,
|
|
264
|
-
)
|
|
265
|
-
namespace: str = Field(..., regex=SAFE_STRING_REGEX)
|
|
266
|
-
metadata: Metadata = Field(
|
|
267
|
-
..., description="Properties used for search and display"
|
|
268
|
-
)
|
|
269
|
-
brand: BrandData = Field(
|
|
270
|
-
...,
|
|
271
|
-
description="Real-world labware that the definition is modeled "
|
|
272
|
-
"from and/or compatible with",
|
|
273
|
-
)
|
|
274
|
-
parameters: Parameters = Field(
|
|
275
|
-
...,
|
|
276
|
-
description="Internal describers used to determine pipette movement "
|
|
277
|
-
"to labware",
|
|
278
|
-
)
|
|
279
|
-
ordering: List[List[str]] = Field(
|
|
280
|
-
...,
|
|
281
|
-
description="Generated array that keeps track of how wells should be "
|
|
282
|
-
"ordered in a labware",
|
|
283
|
-
)
|
|
284
|
-
cornerOffsetFromSlot: CornerOffsetFromSlot = Field(
|
|
285
|
-
...,
|
|
286
|
-
description="Distance from left-front-bottom corner of slot to "
|
|
287
|
-
"left-front-bottom corner of labware bounding box. Used for "
|
|
288
|
-
"labware that spans multiple slots. For labware that does "
|
|
289
|
-
"not span multiple slots, x/y/z should all be zero.",
|
|
290
|
-
)
|
|
291
|
-
dimensions: Dimensions = Field(..., description="Outer dimensions of a labware")
|
|
292
|
-
wells: Dict[str, WellDefinition] = Field(
|
|
293
|
-
...,
|
|
294
|
-
description="Unordered object of well objects with position and "
|
|
295
|
-
"dimensional information",
|
|
296
|
-
)
|
|
297
|
-
groups: List[Group] = Field(
|
|
298
|
-
...,
|
|
299
|
-
description="Logical well groupings for metadata/display purposes; "
|
|
300
|
-
"changes in groups do not affect protocol execution",
|
|
301
|
-
)
|
|
302
|
-
allowedRoles: List[LabwareRole] = Field(
|
|
303
|
-
default_factory=list,
|
|
304
|
-
description="Allowed behaviors and usage of a labware in a protocol.",
|
|
305
|
-
)
|
|
306
|
-
stackingOffsetWithLabware: Dict[str, OverlapOffset] = Field(
|
|
307
|
-
default_factory=dict,
|
|
308
|
-
description="Supported labware that can be stacked upon,"
|
|
309
|
-
" with overlap vector offset between both labware.",
|
|
310
|
-
)
|
|
311
|
-
stackingOffsetWithModule: Dict[str, OverlapOffset] = Field(
|
|
312
|
-
default_factory=dict,
|
|
313
|
-
description="Supported module that can be stacked upon,"
|
|
314
|
-
" with overlap vector offset between labware and module.",
|
|
315
|
-
)
|
|
316
|
-
gripperOffsets: Dict[str, GripperOffsets] = Field(
|
|
317
|
-
default_factory=dict,
|
|
318
|
-
description="Offsets use when calculating coordinates for gripping labware "
|
|
319
|
-
"during labware movement.",
|
|
320
|
-
)
|
|
321
|
-
gripHeightFromLabwareBottom: Optional[float] = Field(
|
|
322
|
-
default_factory=None,
|
|
323
|
-
description="The Z-height, from labware bottom, where the gripper should grip the labware.",
|
|
324
|
-
)
|
|
325
|
-
gripForce: Optional[float] = Field(
|
|
326
|
-
default_factory=None,
|
|
327
|
-
description="Force, in Newtons, with which the gripper should grip the labware.",
|
|
328
|
-
)
|