opentrons 8.4.1a2__py2.py3-none-any.whl → 8.5.0__py2.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.
Files changed (67) hide show
  1. opentrons/config/defaults_ot3.py +1 -1
  2. opentrons/hardware_control/backends/flex_protocol.py +25 -0
  3. opentrons/hardware_control/backends/ot3controller.py +76 -1
  4. opentrons/hardware_control/backends/ot3simulator.py +27 -0
  5. opentrons/hardware_control/instruments/ot3/pipette_handler.py +1 -0
  6. opentrons/hardware_control/ot3api.py +32 -0
  7. opentrons/legacy_commands/commands.py +16 -4
  8. opentrons/legacy_commands/robot_commands.py +51 -0
  9. opentrons/legacy_commands/types.py +91 -2
  10. opentrons/protocol_api/_liquid.py +60 -15
  11. opentrons/protocol_api/_liquid_properties.py +149 -90
  12. opentrons/protocol_api/_transfer_liquid_validation.py +43 -14
  13. opentrons/protocol_api/core/engine/instrument.py +367 -221
  14. opentrons/protocol_api/core/engine/protocol.py +14 -15
  15. opentrons/protocol_api/core/engine/robot.py +2 -2
  16. opentrons/protocol_api/core/engine/transfer_components_executor.py +275 -163
  17. opentrons/protocol_api/core/engine/well.py +16 -0
  18. opentrons/protocol_api/core/instrument.py +11 -5
  19. opentrons/protocol_api/core/legacy/legacy_instrument_core.py +11 -5
  20. opentrons/protocol_api/core/legacy/legacy_protocol_core.py +2 -2
  21. opentrons/protocol_api/core/legacy/legacy_well_core.py +8 -0
  22. opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py +11 -5
  23. opentrons/protocol_api/core/protocol.py +3 -3
  24. opentrons/protocol_api/core/well.py +8 -0
  25. opentrons/protocol_api/instrument_context.py +478 -111
  26. opentrons/protocol_api/labware.py +10 -0
  27. opentrons/protocol_api/module_contexts.py +5 -2
  28. opentrons/protocol_api/protocol_context.py +76 -11
  29. opentrons/protocol_api/robot_context.py +48 -6
  30. opentrons/protocol_api/validation.py +15 -8
  31. opentrons/protocol_engine/commands/command_unions.py +10 -10
  32. opentrons/protocol_engine/commands/generate_command_schema.py +1 -1
  33. opentrons/protocol_engine/commands/get_next_tip.py +2 -2
  34. opentrons/protocol_engine/commands/load_labware.py +0 -19
  35. opentrons/protocol_engine/commands/pick_up_tip.py +9 -3
  36. opentrons/protocol_engine/commands/robot/__init__.py +20 -20
  37. opentrons/protocol_engine/commands/robot/close_gripper_jaw.py +34 -24
  38. opentrons/protocol_engine/commands/robot/open_gripper_jaw.py +29 -20
  39. opentrons/protocol_engine/commands/seal_pipette_to_tip.py +1 -1
  40. opentrons/protocol_engine/commands/unsafe/__init__.py +17 -1
  41. opentrons/protocol_engine/commands/unsafe/unsafe_drop_tip_in_place.py +1 -2
  42. opentrons/protocol_engine/execution/labware_movement.py +9 -2
  43. opentrons/protocol_engine/execution/movement.py +12 -9
  44. opentrons/protocol_engine/execution/queue_worker.py +8 -1
  45. opentrons/protocol_engine/execution/thermocycler_movement_flagger.py +52 -19
  46. opentrons/protocol_engine/resources/labware_validation.py +7 -1
  47. opentrons/protocol_engine/state/_well_math.py +2 -2
  48. opentrons/protocol_engine/state/commands.py +14 -28
  49. opentrons/protocol_engine/state/frustum_helpers.py +11 -7
  50. opentrons/protocol_engine/state/labware.py +12 -0
  51. opentrons/protocol_engine/state/modules.py +1 -1
  52. opentrons/protocol_engine/state/pipettes.py +8 -0
  53. opentrons/protocol_engine/state/tips.py +46 -83
  54. opentrons/protocol_engine/state/update_types.py +8 -23
  55. opentrons/protocol_engine/types/liquid_level_detection.py +68 -8
  56. opentrons/protocol_runner/legacy_command_mapper.py +12 -6
  57. opentrons/protocol_runner/run_orchestrator.py +1 -1
  58. opentrons/protocols/advanced_control/transfers/common.py +54 -11
  59. opentrons/protocols/advanced_control/transfers/transfer_liquid_utils.py +55 -28
  60. opentrons/protocols/api_support/definitions.py +1 -1
  61. opentrons/types.py +6 -6
  62. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/METADATA +4 -4
  63. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/RECORD +67 -66
  64. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/LICENSE +0 -0
  65. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/WHEEL +0 -0
  66. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/entry_points.txt +0 -0
  67. {opentrons-8.4.1a2.dist-info → opentrons-8.5.0.dist-info}/top_level.txt +0 -0
@@ -223,3 +223,19 @@ class WellCore(AbstractWellCore):
223
223
  return self._engine_client.state.geometry.get_current_well_volume(
224
224
  labware_id=labware_id, well_name=well_name
225
225
  )
226
+
227
+ def height_from_volume(self, volume: LiquidTrackingType) -> LiquidTrackingType:
228
+ """Return the height in a well corresponding to a given volume."""
229
+ labware_id = self.labware_id
230
+ well_name = self._name
231
+ return self._engine_client.state.geometry.get_well_height_at_volume(
232
+ labware_id=labware_id, well_name=well_name, volume=volume
233
+ )
234
+
235
+ def volume_from_height(self, height: LiquidTrackingType) -> LiquidTrackingType:
236
+ """Return the volume contained in a well at any height."""
237
+ labware_id = self.labware_id
238
+ well_name = self._name
239
+ return self._engine_client.state.geometry.get_well_volume_at_height(
240
+ labware_id=labware_id, well_name=well_name, height=height
241
+ )
@@ -365,13 +365,15 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
365
365
  liquid_class: LiquidClass,
366
366
  volume: float,
367
367
  source: List[Tuple[types.Location, WellCoreType]],
368
- dest: List[Tuple[types.Location, WellCoreType]],
368
+ dest: Union[List[Tuple[types.Location, WellCoreType]], TrashBin, WasteChute],
369
369
  new_tip: TransferTipPolicyV2,
370
370
  tip_racks: List[Tuple[types.Location, LabwareCoreType]],
371
371
  starting_tip: Optional[WellCoreType],
372
372
  trash_location: Union[types.Location, TrashBin, WasteChute],
373
373
  return_tip: bool,
374
- ) -> None:
374
+ keep_last_tip: bool,
375
+ last_tip_location: Optional[Tuple[types.Location, WellCoreType]],
376
+ ) -> Optional[Tuple[types.Location, WellCoreType]]:
375
377
  """Transfer a liquid from source to dest according to liquid class properties."""
376
378
  ...
377
379
 
@@ -387,7 +389,9 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
387
389
  starting_tip: Optional[WellCoreType],
388
390
  trash_location: Union[types.Location, TrashBin, WasteChute],
389
391
  return_tip: bool,
390
- ) -> None:
392
+ keep_last_tip: bool,
393
+ last_tip_location: Optional[Tuple[types.Location, WellCoreType]],
394
+ ) -> Optional[Tuple[types.Location, WellCoreType]]:
391
395
  """
392
396
  Distribute a liquid from single source to multiple destinations
393
397
  according to liquid class properties.
@@ -400,13 +404,15 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
400
404
  liquid_class: LiquidClass,
401
405
  volume: float,
402
406
  source: List[Tuple[types.Location, WellCoreType]],
403
- dest: Tuple[types.Location, WellCoreType],
407
+ dest: Union[Tuple[types.Location, WellCoreType], TrashBin, WasteChute],
404
408
  new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
405
409
  tip_racks: List[Tuple[types.Location, LabwareCoreType]],
406
410
  starting_tip: Optional[WellCoreType],
407
411
  trash_location: Union[types.Location, TrashBin, WasteChute],
408
412
  return_tip: bool,
409
- ) -> None:
413
+ keep_last_tip: bool,
414
+ last_tip_location: Optional[Tuple[types.Location, WellCoreType]],
415
+ ) -> Optional[Tuple[types.Location, WellCoreType]]:
410
416
  """
411
417
  Consolidate liquid from multiple sources to a single destination
412
418
  using the specified liquid class properties.
@@ -605,13 +605,15 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
605
605
  liquid_class: LiquidClass,
606
606
  volume: float,
607
607
  source: List[Tuple[types.Location, LegacyWellCore]],
608
- dest: List[Tuple[types.Location, LegacyWellCore]],
608
+ dest: Union[List[Tuple[types.Location, LegacyWellCore]], TrashBin, WasteChute],
609
609
  new_tip: TransferTipPolicyV2,
610
610
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
611
611
  starting_tip: Optional[LegacyWellCore],
612
612
  trash_location: Union[types.Location, TrashBin, WasteChute],
613
613
  return_tip: bool,
614
- ) -> None:
614
+ keep_last_tip: bool,
615
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
616
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
615
617
  """This will never be called because it was added in API 2.23"""
616
618
  assert False, "transfer_liquid is not supported in legacy context"
617
619
 
@@ -626,7 +628,9 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
626
628
  starting_tip: Optional[LegacyWellCore],
627
629
  trash_location: Union[types.Location, TrashBin, WasteChute],
628
630
  return_tip: bool,
629
- ) -> None:
631
+ keep_last_tip: bool,
632
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
633
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
630
634
  """This will never be called because it was added in API 2.23"""
631
635
  assert False, "distribute_liquid is not supported in legacy context"
632
636
 
@@ -635,13 +639,15 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
635
639
  liquid_class: LiquidClass,
636
640
  volume: float,
637
641
  source: List[Tuple[types.Location, LegacyWellCore]],
638
- dest: Tuple[types.Location, LegacyWellCore],
642
+ dest: Union[Tuple[types.Location, LegacyWellCore], TrashBin, WasteChute],
639
643
  new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
640
644
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
641
645
  starting_tip: Optional[LegacyWellCore],
642
646
  trash_location: Union[types.Location, TrashBin, WasteChute],
643
647
  return_tip: bool,
644
- ) -> None:
648
+ keep_last_tip: bool,
649
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
650
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
645
651
  """This will never be called because it was added in API 2.23."""
646
652
  assert False, "consolidate_liquid is not supported in legacy context"
647
653
 
@@ -599,8 +599,8 @@ class LegacyProtocolCore(
599
599
  """Define a liquid to load into a well."""
600
600
  assert False, "define_liquid only supported on engine core"
601
601
 
602
- def define_liquid_class(self, name: str) -> LiquidClass:
603
- """Define a liquid class."""
602
+ def get_liquid_class(self, name: str, version: int) -> LiquidClass:
603
+ """Get an instance of a built-in liquid class."""
604
604
  assert False, "define_liquid_class is only supported on engine core"
605
605
 
606
606
  def get_labware_location(
@@ -143,6 +143,14 @@ class LegacyWellCore(AbstractWellCore):
143
143
  """Get the current well volume."""
144
144
  return 0.0
145
145
 
146
+ def height_from_volume(self, volume: LiquidTrackingType) -> LiquidTrackingType:
147
+ """Return the height in a well corresponding to a given volume."""
148
+ return 0.0
149
+
150
+ def volume_from_height(self, height: LiquidTrackingType) -> LiquidTrackingType:
151
+ """Return the volume contained in a well at any height."""
152
+ return 0.0
153
+
146
154
  # TODO(mc, 2022-10-28): is this used and/or necessary?
147
155
  def __repr__(self) -> str:
148
156
  """Use the well's display name as its repr."""
@@ -519,13 +519,15 @@ class LegacyInstrumentCoreSimulator(
519
519
  liquid_class: LiquidClass,
520
520
  volume: float,
521
521
  source: List[Tuple[types.Location, LegacyWellCore]],
522
- dest: List[Tuple[types.Location, LegacyWellCore]],
522
+ dest: Union[List[Tuple[types.Location, LegacyWellCore]], TrashBin, WasteChute],
523
523
  new_tip: TransferTipPolicyV2,
524
524
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
525
525
  starting_tip: Optional[LegacyWellCore],
526
526
  trash_location: Union[types.Location, TrashBin, WasteChute],
527
527
  return_tip: bool,
528
- ) -> None:
528
+ keep_last_tip: bool,
529
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
530
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
529
531
  """This will never be called because it was added in API 2.23."""
530
532
  assert False, "transfer_liquid is not supported in legacy context"
531
533
 
@@ -540,7 +542,9 @@ class LegacyInstrumentCoreSimulator(
540
542
  starting_tip: Optional[LegacyWellCore],
541
543
  trash_location: Union[types.Location, TrashBin, WasteChute],
542
544
  return_tip: bool,
543
- ) -> None:
545
+ keep_last_tip: bool,
546
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
547
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
544
548
  """This will never be called because it was added in API 2.23."""
545
549
  assert False, "distribute_liquid is not supported in legacy context"
546
550
 
@@ -549,13 +553,15 @@ class LegacyInstrumentCoreSimulator(
549
553
  liquid_class: LiquidClass,
550
554
  volume: float,
551
555
  source: List[Tuple[types.Location, LegacyWellCore]],
552
- dest: Tuple[types.Location, LegacyWellCore],
556
+ dest: Union[Tuple[types.Location, LegacyWellCore], TrashBin, WasteChute],
553
557
  new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
554
558
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
555
559
  starting_tip: Optional[LegacyWellCore],
556
560
  trash_location: Union[types.Location, TrashBin, WasteChute],
557
561
  return_tip: bool,
558
- ) -> None:
562
+ keep_last_tip: bool,
563
+ last_tip_location: Optional[Tuple[types.Location, LegacyWellCore]],
564
+ ) -> Optional[Tuple[types.Location, LegacyWellCore]]:
559
565
  """This will never be called because it was added in API 2.23."""
560
566
  assert False, "consolidate_liquid is not supported in legacy context"
561
567
 
@@ -230,7 +230,7 @@ class AbstractProtocol(
230
230
  def get_last_location(
231
231
  self,
232
232
  mount: Optional[Mount] = None,
233
- ) -> Optional[Location]:
233
+ ) -> Optional[Union[Location, TrashBin, WasteChute]]:
234
234
  ...
235
235
 
236
236
  @abstractmethod
@@ -311,8 +311,8 @@ class AbstractProtocol(
311
311
  """Define a liquid to load into a well."""
312
312
 
313
313
  @abstractmethod
314
- def define_liquid_class(self, name: str) -> LiquidClass:
315
- """Define a liquid class for use in transfer functions."""
314
+ def get_liquid_class(self, name: str, version: int) -> LiquidClass:
315
+ """Get an instance of a built-in liquid class."""
316
316
 
317
317
  @abstractmethod
318
318
  def get_labware_location(
@@ -104,5 +104,13 @@ class AbstractWellCore(ABC):
104
104
  def get_liquid_volume(self) -> LiquidTrackingType:
105
105
  """Get the current volume within a well."""
106
106
 
107
+ @abstractmethod
108
+ def height_from_volume(self, volume: LiquidTrackingType) -> LiquidTrackingType:
109
+ """Return the height in a well corresponding to a given volume."""
110
+
111
+ @abstractmethod
112
+ def volume_from_height(self, height: LiquidTrackingType) -> LiquidTrackingType:
113
+ """Return the volume contained in a well at any height."""
114
+
107
115
 
108
116
  WellCoreType = TypeVar("WellCoreType", bound=AbstractWellCore)