opentrons-shared-data 8.8.0a12__py3-none-any.whl → 9.0.0a2__py3-none-any.whl
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.
- opentrons_shared_data/__init__.py +1 -2
- opentrons_shared_data/_version.py +2 -2
- opentrons_shared_data/command/__init__.py +6 -6
- opentrons_shared_data/data/command/schemas/16.json +7690 -0
- opentrons_shared_data/data/commandAnnotation/schemas/2.json +105 -0
- opentrons_shared_data/data/deck/definitions/5/ot3_standard.json +24 -0
- opentrons_shared_data/data/labware/definitions/2/black_96_well_microtiter_plate_lid/2.json +110 -0
- opentrons_shared_data/data/labware/definitions/2/corning_96_wellplate_360ul_lid/2.json +117 -0
- opentrons_shared_data/data/labware/definitions/2/corning_falcon_384_wellplate_130ul_flat_lid/2.json +118 -0
- opentrons_shared_data/data/labware/definitions/2/thermofisher_nunc_maxisorp_lockwell_elisa/1.json +1168 -0
- opentrons_shared_data/data/liquid-class/definitions/1/water/3.json +7880 -0
- opentrons_shared_data/data/liquid-class/schemas/1.json +3 -0
- opentrons_shared_data/data/module/definitions/3/vacuumModuleMilliporeV1.json +70 -0
- opentrons_shared_data/data/module/schemas/3.json +3 -2
- opentrons_shared_data/data/pipette/definitions/2/general/eight_channel/p50/3_0.json +27 -9
- opentrons_shared_data/data/pipette/definitions/2/general/eight_channel/p50/3_3.json +27 -9
- opentrons_shared_data/data/pipette/definitions/2/general/eight_channel/p50/3_4.json +53 -15
- opentrons_shared_data/data/pipette/definitions/2/general/eight_channel/p50/3_5.json +53 -15
- opentrons_shared_data/data/pipette/definitions/2/general/ninety_six_channel/p200/3_0.json +154 -13
- opentrons_shared_data/data/pipette/definitions/2/general/ninety_six_channel/p200/3_1.json +187 -18
- opentrons_shared_data/data/pipette/definitions/2/general/ninety_six_channel/p200/3_2.json +187 -18
- opentrons_shared_data/data/pipette/definitions/2/general/single_channel/p50/3_0.json +2 -0
- opentrons_shared_data/data/pipette/definitions/2/general/single_channel/p50/3_3.json +2 -0
- opentrons_shared_data/data/pipette/definitions/2/general/single_channel/p50/3_4.json +4 -0
- opentrons_shared_data/data/pipette/definitions/2/general/single_channel/p50/3_5.json +4 -0
- opentrons_shared_data/data/pipette/definitions/2/general/single_channel/p50/3_6.json +4 -0
- opentrons_shared_data/data/pipette/definitions/2/geometry/single_channel/p1000/2_2.json +2 -2
- opentrons_shared_data/data/pipette/definitions/2/geometry/single_channel/p1000/3_5.json +4 -0
- opentrons_shared_data/data/pipette/definitions/2/geometry/single_channel/p20/2_2.json +2 -2
- opentrons_shared_data/data/pipette/definitions/2/geometry/single_channel/p300/2_1.json +2 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/default/3_0.json +67 -0
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/default/3_3.json +68 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/default/3_4.json +67 -0
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/default/3_5.json +2 -0
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/lowVolumeDefault/3_0.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/lowVolumeDefault/3_3.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/lowVolumeDefault/3_4.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/eight_channel/p50/lowVolumeDefault/3_5.json +4 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/ninety_six_channel/p200/default/3_0.json +2 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/default/3_0.json +68 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/default/3_3.json +68 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/default/3_4.json +68 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/default/3_5.json +3 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/default/3_6.json +3 -1
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/lowVolumeDefault/3_0.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/lowVolumeDefault/3_3.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/lowVolumeDefault/3_4.json +67 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/lowVolumeDefault/3_5.json +4 -2
- opentrons_shared_data/data/pipette/definitions/2/liquid/single_channel/p50/lowVolumeDefault/3_6.json +4 -2
- opentrons_shared_data/data_files/__init__.py +5 -6
- opentrons_shared_data/data_files/types.py +4 -2
- opentrons_shared_data/deck/__init__.py +11 -13
- opentrons_shared_data/deck/types.py +2 -2
- opentrons_shared_data/errors/__init__.py +2 -2
- opentrons_shared_data/errors/categories.py +2 -3
- opentrons_shared_data/errors/codes.py +3 -3
- opentrons_shared_data/errors/exceptions.py +13 -13
- opentrons_shared_data/gripper/__init__.py +7 -5
- opentrons_shared_data/gripper/gripper_definition.py +6 -4
- opentrons_shared_data/labware/__init__.py +5 -8
- opentrons_shared_data/labware/constants.py +1 -1
- opentrons_shared_data/labware/labware_definition.py +15 -14
- opentrons_shared_data/labware/types.py +5 -2
- opentrons_shared_data/liquid_classes/__init__.py +3 -2
- opentrons_shared_data/liquid_classes/liquid_class_definition.py +47 -22
- opentrons_shared_data/liquid_classes/types.py +5 -1
- opentrons_shared_data/load.py +2 -2
- opentrons_shared_data/module/__init__.py +12 -14
- opentrons_shared_data/module/types.py +7 -1
- opentrons_shared_data/pipette/__init__.py +9 -8
- opentrons_shared_data/pipette/dev_types.py +3 -3
- opentrons_shared_data/pipette/file_operation_helpers.py +2 -2
- opentrons_shared_data/pipette/load_data.py +8 -10
- opentrons_shared_data/pipette/model_constants.py +4 -4
- opentrons_shared_data/pipette/mutable_configurations.py +20 -20
- opentrons_shared_data/pipette/pipette_definition.py +7 -5
- opentrons_shared_data/pipette/pipette_load_name_conversions.py +11 -10
- opentrons_shared_data/pipette/scripts/build_json_script.py +11 -13
- opentrons_shared_data/pipette/scripts/update_configuration_files.py +17 -18
- opentrons_shared_data/pipette/types.py +1 -2
- opentrons_shared_data/pipette/ul_per_mm.py +1 -1
- opentrons_shared_data/protocol/__init__.py +2 -1
- opentrons_shared_data/protocol/constants.py +25 -82
- opentrons_shared_data/protocol/models/__init__.py +11 -10
- opentrons_shared_data/protocol/models/protocol_schema_v6.py +10 -9
- opentrons_shared_data/protocol/models/protocol_schema_v7.py +9 -9
- opentrons_shared_data/protocol/models/protocol_schema_v8.py +10 -8
- opentrons_shared_data/protocol/models/shared_models.py +2 -1
- opentrons_shared_data/protocol/types.py +4 -3
- opentrons_shared_data/robot/__init__.py +3 -3
- opentrons_shared_data/robot/types.py +4 -2
- opentrons_shared_data/util/__init__.py +21 -0
- {opentrons_shared_data-8.8.0a12.dist-info → opentrons_shared_data-9.0.0a2.dist-info}/METADATA +2 -1
- {opentrons_shared_data-8.8.0a12.dist-info → opentrons_shared_data-9.0.0a2.dist-info}/RECORD +96 -87
- {opentrons_shared_data-8.8.0a12.dist-info → opentrons_shared_data-9.0.0a2.dist-info}/WHEEL +0 -0
- {opentrons_shared_data-8.8.0a12.dist-info → opentrons_shared_data-9.0.0a2.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,33 +6,34 @@ shared-data. It's been modified by hand to be more friendly.
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
from enum import Enum
|
|
9
|
-
from math import sqrt, asin
|
|
10
|
-
from typing import Final
|
|
11
|
-
from numpy import pi, trapz
|
|
12
9
|
from functools import cached_property
|
|
10
|
+
from math import asin, sqrt
|
|
11
|
+
from typing import Final
|
|
13
12
|
|
|
13
|
+
from numpy import pi, trapz
|
|
14
14
|
from pydantic import (
|
|
15
|
-
ConfigDict,
|
|
16
15
|
BaseModel,
|
|
16
|
+
ConfigDict,
|
|
17
17
|
Discriminator,
|
|
18
18
|
Field,
|
|
19
|
-
StrictInt,
|
|
20
19
|
StrictFloat,
|
|
20
|
+
StrictInt,
|
|
21
21
|
TypeAdapter,
|
|
22
22
|
)
|
|
23
23
|
from typing_extensions import Annotated, Literal
|
|
24
24
|
|
|
25
|
-
from
|
|
25
|
+
from ..util import StrEnum
|
|
26
26
|
from .constants import (
|
|
27
|
+
Circular,
|
|
27
28
|
Conical,
|
|
28
29
|
Cuboidal,
|
|
30
|
+
Rectangular,
|
|
29
31
|
RoundedCuboid,
|
|
30
|
-
SquaredCone,
|
|
31
32
|
Spherical,
|
|
33
|
+
SquaredCone,
|
|
32
34
|
WellShape,
|
|
33
|
-
Circular,
|
|
34
|
-
Rectangular,
|
|
35
35
|
)
|
|
36
|
+
from .types import LocatingFeatures
|
|
36
37
|
|
|
37
38
|
SAFE_STRING_REGEX = "^[a-z0-9._]+$"
|
|
38
39
|
RECURSIVE_SEARCH_VOLUME_TOLERANCE = 0.001
|
|
@@ -93,7 +94,7 @@ class BrandData(BaseModel):
|
|
|
93
94
|
links: list[str] | None = None
|
|
94
95
|
|
|
95
96
|
|
|
96
|
-
class DisplayCategory(
|
|
97
|
+
class DisplayCategory(StrEnum):
|
|
97
98
|
tipRack = "tipRack"
|
|
98
99
|
tubeRack = "tubeRack"
|
|
99
100
|
reservoir = "reservoir"
|
|
@@ -106,7 +107,7 @@ class DisplayCategory(str, Enum):
|
|
|
106
107
|
system = "system"
|
|
107
108
|
|
|
108
109
|
|
|
109
|
-
class LabwareRole(
|
|
110
|
+
class LabwareRole(StrEnum):
|
|
110
111
|
labware = "labware"
|
|
111
112
|
fixture = "fixture"
|
|
112
113
|
adapter = "adapter"
|
|
@@ -587,9 +588,9 @@ class LabwareDefinition2(BaseModel):
|
|
|
587
588
|
gripHeightFromLabwareBottom: float | None = None
|
|
588
589
|
stackLimit: int | None = None
|
|
589
590
|
compatibleParentLabware: list[str] | None = None
|
|
590
|
-
innerLabwareGeometry: dict[
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
innerLabwareGeometry: dict[str, InnerWellGeometry | UserDefinedVolumes] | None = (
|
|
592
|
+
None
|
|
593
|
+
)
|
|
593
594
|
|
|
594
595
|
|
|
595
596
|
class LabwareDefinition3(BaseModel):
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""opentrons_shared_data.labware.types: types for labware defs
|
|
2
2
|
|
|
3
3
|
types in this file by and large require the use of typing_extensions.
|
|
4
4
|
this module shouldn't be imported unless typing.TYPE_CHECKING is true.
|
|
5
5
|
"""
|
|
6
|
+
|
|
6
7
|
from typing import NewType
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
from typing_extensions import Literal, NotRequired, TypedDict
|
|
10
|
+
|
|
8
11
|
from .constants import (
|
|
9
12
|
CircularType,
|
|
10
13
|
RectangularType,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""Types and functions for accessing liquid class definitions."""
|
|
2
|
+
|
|
2
3
|
from pathlib import Path
|
|
3
|
-
from .. import load_shared_data, get_shared_data_root
|
|
4
|
-
from .liquid_class_definition import LiquidClassSchemaV1
|
|
5
4
|
|
|
5
|
+
from .. import get_shared_data_root, load_shared_data
|
|
6
|
+
from .liquid_class_definition import LiquidClassSchemaV1
|
|
6
7
|
|
|
7
8
|
DEFAULT_SCHEMA_VERSION = 1
|
|
8
9
|
DEFAULT_LC_VERSION = 1
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"""Python shared data models for liquid class definitions."""
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from typing import
|
|
4
|
+
from typing import Any, Literal, Optional, Sequence, Tuple, Type, Union
|
|
5
5
|
|
|
6
6
|
from pydantic import (
|
|
7
|
-
ConfigDict,
|
|
8
7
|
BaseModel,
|
|
9
|
-
|
|
10
|
-
ValidationInfo,
|
|
8
|
+
ConfigDict,
|
|
11
9
|
Field,
|
|
12
|
-
StrictInt,
|
|
13
|
-
StrictFloat,
|
|
14
10
|
StrictBool,
|
|
11
|
+
StrictFloat,
|
|
12
|
+
StrictInt,
|
|
13
|
+
ValidationInfo,
|
|
14
|
+
field_validator,
|
|
15
15
|
model_validator,
|
|
16
16
|
)
|
|
17
17
|
from pydantic.json_schema import SkipJsonSchema
|
|
18
18
|
from typing_extensions import Annotated
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
_StrictNonNegativeInt = Annotated[int, Field(strict=True, ge=0)]
|
|
22
21
|
_StrictGreaterThanZeroInt = Annotated[int, Field(strict=True, gt=0)]
|
|
23
22
|
_StrictGreaterThanZeroFloat = Annotated[float, Field(strict=True, gt=0.0)]
|
|
@@ -70,7 +69,13 @@ class BlowoutLocation(Enum):
|
|
|
70
69
|
TRASH = "trash"
|
|
71
70
|
|
|
72
71
|
|
|
73
|
-
class
|
|
72
|
+
class BaseLiquidClassModel(BaseModel):
|
|
73
|
+
"""Base class for liquid class definitions."""
|
|
74
|
+
|
|
75
|
+
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class Coordinate(BaseLiquidClassModel):
|
|
74
79
|
"""Three-dimensional coordinates."""
|
|
75
80
|
|
|
76
81
|
x: _Number
|
|
@@ -78,12 +83,6 @@ class Coordinate(BaseModel):
|
|
|
78
83
|
z: _Number
|
|
79
84
|
|
|
80
85
|
|
|
81
|
-
class BaseLiquidClassModel(BaseModel):
|
|
82
|
-
"""Base class for liquid class definitions."""
|
|
83
|
-
|
|
84
|
-
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
85
|
-
|
|
86
|
-
|
|
87
86
|
class TipPosition(BaseLiquidClassModel):
|
|
88
87
|
"""Properties for tip position reference and relative offset."""
|
|
89
88
|
|
|
@@ -252,6 +251,12 @@ class BlowoutParams(BaseLiquidClassModel):
|
|
|
252
251
|
alias="flow_rate",
|
|
253
252
|
description="Flow rate for blow out, in microliters per second.",
|
|
254
253
|
)
|
|
254
|
+
blowoutPosition: Optional[TipPosition] | SkipJsonSchema[None] = Field(
|
|
255
|
+
None,
|
|
256
|
+
alias="blowout_position",
|
|
257
|
+
description="Position of the tip during blowout.",
|
|
258
|
+
json_schema_extra=_remove_default,
|
|
259
|
+
)
|
|
255
260
|
|
|
256
261
|
|
|
257
262
|
class BlowoutProperties(BaseLiquidClassModel):
|
|
@@ -311,23 +316,43 @@ def reshape_glob(
|
|
|
311
316
|
data["enable"] = data["enabled"]
|
|
312
317
|
data.pop("enabled")
|
|
313
318
|
|
|
314
|
-
params_list = [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
319
|
+
params_list = [
|
|
320
|
+
meta.alias for field, meta in params_model.model_fields.items()
|
|
321
|
+
] # List of all params in the *model*, including optional ones
|
|
322
|
+
required_params = [
|
|
323
|
+
meta.alias
|
|
324
|
+
for field, meta in params_model.model_fields.items()
|
|
325
|
+
if meta.is_required()
|
|
326
|
+
] # List of strictly required params
|
|
327
|
+
|
|
328
|
+
# List of booleans specifying if each required param is present in the data
|
|
329
|
+
required_params_in_data = [param in data.keys() for param in required_params]
|
|
330
|
+
if any(required_params_in_data):
|
|
331
|
+
if not all(required_params_in_data):
|
|
318
332
|
raise ValueError(
|
|
319
333
|
f"{property_name} should specify either all of the params-"
|
|
320
|
-
f"{
|
|
334
|
+
f"{required_params} - or none of them."
|
|
321
335
|
)
|
|
322
336
|
if data.get("params"):
|
|
323
337
|
raise ValueError(
|
|
324
338
|
f"{property_name} should specify either all of"
|
|
325
|
-
f" {
|
|
339
|
+
f" {required_params} or 'params', not both."
|
|
326
340
|
)
|
|
341
|
+
# Get a list of the required params + the optional params in the data.
|
|
342
|
+
# Then move them all under a new "params" key.
|
|
343
|
+
# This list purposely skips any extra, non-param keys present in the data so that the model validator
|
|
344
|
+
# can raise a validation error upon encountering the unexpected keys.
|
|
345
|
+
all_params_in_data = [
|
|
346
|
+
param
|
|
347
|
+
for param in params_list
|
|
348
|
+
if param in required_params
|
|
349
|
+
or (param not in required_params and data.get(param) is not None)
|
|
350
|
+
]
|
|
327
351
|
data["params"] = params_model.model_validate(
|
|
328
|
-
{param: data[param] for param in
|
|
352
|
+
{param: data[param] for param in all_params_in_data}
|
|
329
353
|
)
|
|
330
|
-
|
|
354
|
+
# Remove the params from the data dict
|
|
355
|
+
for param in all_params_in_data:
|
|
331
356
|
data.pop(param)
|
|
332
357
|
return data
|
|
333
358
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"""Type definitions for liquid classes."""
|
|
2
|
+
|
|
2
3
|
from typing import Sequence, Tuple, TypedDict
|
|
4
|
+
|
|
3
5
|
from typing_extensions import NotRequired
|
|
6
|
+
|
|
4
7
|
from .liquid_class_definition import (
|
|
5
|
-
POSITION_REFERENCE_VALUE_TYPE,
|
|
6
8
|
BLOWOUT_LOCATION_VALUE_TYPE,
|
|
9
|
+
POSITION_REFERENCE_VALUE_TYPE,
|
|
7
10
|
)
|
|
8
11
|
|
|
9
12
|
|
|
@@ -52,6 +55,7 @@ class BlowoutPropertiesDict(TypedDict):
|
|
|
52
55
|
enabled: bool
|
|
53
56
|
location: NotRequired[BLOWOUT_LOCATION_VALUE_TYPE]
|
|
54
57
|
flow_rate: NotRequired[float]
|
|
58
|
+
blowout_position: NotRequired[TipPositionDict]
|
|
55
59
|
|
|
56
60
|
|
|
57
61
|
class SubmergeDict(TypedDict):
|
opentrons_shared_data/load.py
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""opentrons_shared_data.module: functions and types for module defs"""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
from ast import literal_eval
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
from typing import Union, cast, overload
|
|
7
5
|
from functools import lru_cache
|
|
8
6
|
from itertools import product
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Union, cast, overload
|
|
9
9
|
|
|
10
10
|
from ..load import load_shared_data
|
|
11
11
|
from .types import (
|
|
12
|
-
SchemaVersions,
|
|
13
|
-
ModuleSchema,
|
|
14
|
-
SchemaV1,
|
|
15
|
-
SchemaV3,
|
|
16
12
|
ModuleDefinitionV1,
|
|
17
13
|
ModuleDefinitionV3,
|
|
18
14
|
ModuleModel,
|
|
15
|
+
ModuleSchema,
|
|
16
|
+
SchemaV1,
|
|
17
|
+
SchemaV3,
|
|
18
|
+
SchemaVersions,
|
|
19
19
|
TOFSensorBaseline,
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
OLD_TC_GEN2_LABWARE_OFFSET = {"x": 0, "y": 68.06, "z": 98.26}
|
|
24
23
|
|
|
25
24
|
# TODO (spp, 2023-02-14): these values are measured experimentally, and aren't from
|
|
@@ -51,8 +50,7 @@ class ModuleNotFoundError(KeyError):
|
|
|
51
50
|
|
|
52
51
|
def __str__(self) -> str:
|
|
53
52
|
return (
|
|
54
|
-
f"No such version {self.requested_version} module "
|
|
55
|
-
f"{self.requested_module}"
|
|
53
|
+
f"No such version {self.requested_version} module {self.requested_module}"
|
|
56
54
|
)
|
|
57
55
|
|
|
58
56
|
def __repr__(self) -> str:
|
|
@@ -68,16 +66,16 @@ def load_schema(version: SchemaVersions) -> ModuleSchema:
|
|
|
68
66
|
|
|
69
67
|
|
|
70
68
|
@overload
|
|
71
|
-
def load_definition(
|
|
72
|
-
|
|
69
|
+
def load_definition(
|
|
70
|
+
version: SchemaV1, model_or_loadname: str
|
|
71
|
+
) -> ModuleDefinitionV1: ...
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
@overload
|
|
76
75
|
def load_definition(
|
|
77
76
|
version: SchemaV3,
|
|
78
77
|
model_or_loadname: Union[str, ModuleModel],
|
|
79
|
-
) -> ModuleDefinitionV3:
|
|
80
|
-
...
|
|
78
|
+
) -> ModuleDefinitionV3: ...
|
|
81
79
|
|
|
82
80
|
|
|
83
81
|
def load_definition(
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
opentrons_shared_data.module.types: types requiring typing_extensions
|
|
3
3
|
for modules
|
|
4
4
|
"""
|
|
5
|
+
|
|
5
6
|
import enum
|
|
6
7
|
from typing import Any, Dict, List, Union
|
|
8
|
+
|
|
7
9
|
from typing_extensions import Literal, TypedDict
|
|
8
10
|
|
|
9
|
-
from opentrons_shared_data.labware.types import
|
|
11
|
+
from opentrons_shared_data.labware.types import Extents, LocatingFeatures
|
|
10
12
|
|
|
11
13
|
SchemaV1 = Literal["1"]
|
|
12
14
|
SchemaV2 = Literal["2"]
|
|
@@ -22,6 +24,7 @@ HeaterShakerModuleType = Literal["heaterShakerModuleType"]
|
|
|
22
24
|
MagneticBlockType = Literal["magneticBlockType"]
|
|
23
25
|
AbsorbanceReaderType = Literal["absorbanceReaderType"]
|
|
24
26
|
FlexStackerModuleType = Literal["flexStackerModuleType"]
|
|
27
|
+
VacuumModuleType = Literal["vacuumModuleType"]
|
|
25
28
|
|
|
26
29
|
ModuleType = Union[
|
|
27
30
|
MagneticModuleType,
|
|
@@ -31,6 +34,7 @@ ModuleType = Union[
|
|
|
31
34
|
MagneticBlockType,
|
|
32
35
|
AbsorbanceReaderType,
|
|
33
36
|
FlexStackerModuleType,
|
|
37
|
+
VacuumModuleType,
|
|
34
38
|
]
|
|
35
39
|
|
|
36
40
|
MagneticModuleModel = Literal["magneticModuleV1", "magneticModuleV2"]
|
|
@@ -40,6 +44,7 @@ HeaterShakerModuleModel = Literal["heaterShakerModuleV1"]
|
|
|
40
44
|
MagneticBlockModel = Literal["magneticBlockV1"]
|
|
41
45
|
AbsorbanceReaderModel = Literal["absorbanceReaderV1"]
|
|
42
46
|
FlexStackerModuleModel = Literal["flexStackerModuleV1"]
|
|
47
|
+
VacuumModuleModel = Literal["vacuumModuleMilliporeV1"]
|
|
43
48
|
|
|
44
49
|
ModuleModel = Union[
|
|
45
50
|
MagneticModuleModel,
|
|
@@ -49,6 +54,7 @@ ModuleModel = Union[
|
|
|
49
54
|
MagneticBlockModel,
|
|
50
55
|
AbsorbanceReaderModel,
|
|
51
56
|
FlexStackerModuleModel,
|
|
57
|
+
VacuumModuleModel,
|
|
52
58
|
]
|
|
53
59
|
|
|
54
60
|
ModuleSlotTransform = TypedDict(
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
1
|
"""
|
|
4
2
|
opentrons_shared_data.pipette: functions and types for pipette config
|
|
5
3
|
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
6
7
|
import copy
|
|
7
|
-
from typing import TYPE_CHECKING, Dict, Optional
|
|
8
8
|
import json
|
|
9
9
|
from functools import lru_cache
|
|
10
|
+
from typing import TYPE_CHECKING, Dict, Optional
|
|
10
11
|
|
|
11
12
|
from .. import load_shared_data
|
|
12
13
|
|
|
13
14
|
if TYPE_CHECKING:
|
|
14
15
|
from .types import (
|
|
15
|
-
|
|
16
|
+
ChannelCount,
|
|
17
|
+
PipetteFusedSpec,
|
|
18
|
+
PipetteModel,
|
|
16
19
|
PipetteModelSpecs,
|
|
17
20
|
PipetteName,
|
|
18
|
-
|
|
19
|
-
PipetteFusedSpec,
|
|
20
|
-
ChannelCount,
|
|
21
|
+
PipetteNameSpecs,
|
|
21
22
|
)
|
|
22
23
|
|
|
23
24
|
|
|
@@ -89,7 +90,7 @@ def _fuse_specs_cached(
|
|
|
89
90
|
|
|
90
91
|
if pipette_name not in valid_names:
|
|
91
92
|
raise KeyError(
|
|
92
|
-
f"pipette name {pipette_name} is not valid for model
|
|
93
|
+
f"pipette name {pipette_name} is not valid for model {pipette_model}"
|
|
93
94
|
)
|
|
94
95
|
name_data = _name_config()[pipette_name]
|
|
95
96
|
# unfortunately, mypy can't verify this way to build typed dicts - we'll
|
|
@@ -4,7 +4,7 @@ require typing_extensions.
|
|
|
4
4
|
|
|
5
5
|
This module should only be imported if typing.TYPE_CHECKING is True.
|
|
6
6
|
"""
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
from typing import Dict, List, NewType, Union
|
|
9
9
|
|
|
10
10
|
from typing_extensions import Literal, TypedDict
|
|
@@ -12,7 +12,7 @@ from typing_extensions import Literal, TypedDict
|
|
|
12
12
|
# TODO(mc, 2022-06-16): remove type alias when able
|
|
13
13
|
# and when certain removal will not break any pickling
|
|
14
14
|
from ..labware.types import LabwareUri as LabwareUri
|
|
15
|
-
|
|
15
|
+
from ..util import StrEnum
|
|
16
16
|
|
|
17
17
|
PipetteName = Literal[
|
|
18
18
|
"p10_single",
|
|
@@ -37,7 +37,7 @@ PipetteName = Literal[
|
|
|
37
37
|
]
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
class PipetteNameType(
|
|
40
|
+
class PipetteNameType(StrEnum):
|
|
41
41
|
"""Pipette load name values."""
|
|
42
42
|
|
|
43
43
|
value: PipetteName
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from typing import Any, Dict, Union
|
|
3
|
-
from .types import MutableConfig, QuirkConfig
|
|
4
|
-
from .model_constants import VALID_QUIRKS
|
|
5
3
|
|
|
4
|
+
from .model_constants import VALID_QUIRKS
|
|
5
|
+
from .types import MutableConfig, QuirkConfig
|
|
6
6
|
|
|
7
7
|
DecoderType = Union[Dict[str, Any], Dict[str, QuirkConfig], MutableConfig]
|
|
8
8
|
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from
|
|
2
|
+
from functools import lru_cache
|
|
3
3
|
from logging import getLogger
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Dict, Iterator, List, Optional, Union
|
|
4
6
|
|
|
5
|
-
from typing import Dict, Any, Union, Optional, List, Iterator
|
|
6
7
|
from typing_extensions import Literal
|
|
7
|
-
from functools import lru_cache
|
|
8
|
-
|
|
9
|
-
from .. import load_shared_data, get_shared_data_root
|
|
10
8
|
|
|
9
|
+
from .. import get_shared_data_root, load_shared_data
|
|
10
|
+
from .model_constants import _MAP_KEY_TO_V2, MOUNT_CONFIG_LOOKUP_TABLE
|
|
11
11
|
from .pipette_definition import (
|
|
12
12
|
PipetteConfigurations,
|
|
13
13
|
PipetteLiquidPropertiesDefinition,
|
|
14
14
|
ValidNozzleMaps,
|
|
15
15
|
)
|
|
16
|
-
from .model_constants import MOUNT_CONFIG_LOOKUP_TABLE, _MAP_KEY_TO_V2
|
|
17
16
|
from .types import (
|
|
17
|
+
LiquidClasses,
|
|
18
18
|
PipetteChannelType,
|
|
19
|
-
PipetteModelType,
|
|
20
19
|
PipetteGenerationType,
|
|
21
|
-
PipetteVersionType,
|
|
22
20
|
PipetteModelMajorVersion,
|
|
23
21
|
PipetteModelMinorVersion,
|
|
24
|
-
|
|
22
|
+
PipetteModelType,
|
|
25
23
|
PipetteOEMType,
|
|
24
|
+
PipetteVersionType,
|
|
26
25
|
)
|
|
27
26
|
|
|
28
|
-
|
|
29
27
|
LoadedConfiguration = Dict[str, Union[str, Dict[str, Any]]]
|
|
30
28
|
|
|
31
29
|
LOG = getLogger(__name__)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from typing import Dict,
|
|
1
|
+
from typing import Dict, List, Union
|
|
2
2
|
|
|
3
3
|
from .types import (
|
|
4
|
-
Quirks,
|
|
5
|
-
RobotMountConfigs,
|
|
6
4
|
AvailableUnits,
|
|
7
|
-
PipetteGenerationType,
|
|
8
5
|
PipetteChannelType,
|
|
6
|
+
PipetteGenerationType,
|
|
7
|
+
Quirks,
|
|
8
|
+
RobotMountConfigs,
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
MOUNT_CONFIG_LOOKUP_TABLE = {
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import json
|
|
2
|
+
import logging
|
|
3
3
|
import re
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from typing import Optional, List, Dict, Any, cast
|
|
6
4
|
from enum import Enum
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any, Dict, List, Optional, cast
|
|
7
7
|
|
|
8
|
-
from .
|
|
8
|
+
from .file_operation_helpers import (
|
|
9
|
+
MutableConfigurationDecoder,
|
|
10
|
+
MutableConfigurationEncoder,
|
|
11
|
+
)
|
|
12
|
+
from .load_data import load_definition, load_serial_lookup_table
|
|
9
13
|
from .model_constants import (
|
|
10
|
-
MUTABLE_CONFIGS_V1,
|
|
11
|
-
VALID_QUIRKS,
|
|
12
14
|
_MAP_KEY_TO_V2,
|
|
13
15
|
_MIN_MAX_LOOKUP,
|
|
14
16
|
_TYPE_LOOKUP,
|
|
15
17
|
_UNITS_LOOKUP,
|
|
18
|
+
MUTABLE_CONFIGS_V1,
|
|
19
|
+
VALID_QUIRKS,
|
|
16
20
|
)
|
|
17
|
-
from .
|
|
18
|
-
from .types import (
|
|
19
|
-
MutableConfig,
|
|
20
|
-
Quirks,
|
|
21
|
-
QuirkConfig,
|
|
22
|
-
TypeOverrides,
|
|
23
|
-
OverrideType,
|
|
24
|
-
LiquidClasses,
|
|
25
|
-
)
|
|
21
|
+
from .pipette_definition import PipetteConfigurations, PipetteModelVersionType
|
|
26
22
|
from .pipette_load_name_conversions import (
|
|
27
23
|
convert_pipette_model,
|
|
28
24
|
convert_to_pipette_name_type,
|
|
29
25
|
)
|
|
30
|
-
from .
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
from .types import (
|
|
27
|
+
LiquidClasses,
|
|
28
|
+
MutableConfig,
|
|
29
|
+
OverrideType,
|
|
30
|
+
PipetteModel,
|
|
31
|
+
PipetteName,
|
|
32
|
+
QuirkConfig,
|
|
33
|
+
Quirks,
|
|
34
|
+
TypeOverrides,
|
|
33
35
|
)
|
|
34
|
-
from .types import PipetteModel, PipetteName
|
|
35
|
-
|
|
36
36
|
|
|
37
37
|
log = logging.getLogger(__name__)
|
|
38
38
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import re
|
|
2
|
-
from
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Annotated, Dict, List, Literal, Optional, Tuple, TypeVar
|
|
4
|
+
|
|
3
5
|
from pydantic import (
|
|
4
|
-
field_validator,
|
|
5
6
|
BaseModel,
|
|
6
|
-
Field,
|
|
7
7
|
BeforeValidator,
|
|
8
|
+
Field,
|
|
8
9
|
PlainSerializer,
|
|
10
|
+
field_validator,
|
|
9
11
|
)
|
|
10
|
-
from dataclasses import dataclass
|
|
11
12
|
|
|
12
|
-
from . import types
|
|
13
|
+
from . import types
|
|
14
|
+
from . import types as pip_types
|
|
13
15
|
|
|
14
16
|
# The highest and lowest existing overlap version values.
|
|
15
17
|
TIP_OVERLAP_VERSION_MINIMUM = 0
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import re
|
|
2
2
|
from functools import lru_cache
|
|
3
|
-
from typing import List,
|
|
4
|
-
from opentrons_shared_data import get_shared_data_root
|
|
5
|
-
from .types import PipetteModel, PipetteName
|
|
3
|
+
from typing import List, Literal, Optional, Tuple, Union, cast
|
|
6
4
|
|
|
5
|
+
from .pipette_definition import (
|
|
6
|
+
PipetteModelVersionType,
|
|
7
|
+
PipetteNameType,
|
|
8
|
+
)
|
|
7
9
|
from .types import (
|
|
8
10
|
PipetteChannelType,
|
|
9
|
-
PipetteModelType,
|
|
10
|
-
PipetteVersionType,
|
|
11
11
|
PipetteGenerationType,
|
|
12
|
+
PipetteModel,
|
|
12
13
|
PipetteModelMajorVersionType,
|
|
13
14
|
PipetteModelMinorVersionType,
|
|
15
|
+
PipetteModelType,
|
|
16
|
+
PipetteName,
|
|
14
17
|
PipetteOEMType,
|
|
18
|
+
PipetteVersionType,
|
|
15
19
|
)
|
|
16
|
-
from
|
|
17
|
-
PipetteNameType,
|
|
18
|
-
PipetteModelVersionType,
|
|
19
|
-
)
|
|
20
|
+
from opentrons_shared_data import get_shared_data_root
|
|
20
21
|
|
|
21
22
|
DEFAULT_CALIBRATION_OFFSET = [0.0, 0.0, 0.0]
|
|
22
23
|
DEFAULT_MODEL = PipetteModelType.p1000
|
|
@@ -211,7 +212,7 @@ def generation_from_string(pipette_name_list: List[str]) -> PipetteGenerationTyp
|
|
|
211
212
|
|
|
212
213
|
|
|
213
214
|
def convert_to_pipette_name_type(
|
|
214
|
-
model_or_name: Union[PipetteName, PipetteModel]
|
|
215
|
+
model_or_name: Union[PipetteName, PipetteModel],
|
|
215
216
|
) -> PipetteNameType:
|
|
216
217
|
"""Convert the py:data:PipetteName to a py:obj:PipetteModelVersionType.
|
|
217
218
|
|