opentrons 8.4.0a3__py2.py3-none-any.whl → 8.4.0a5__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 (42) hide show
  1. opentrons/legacy_commands/commands.py +83 -2
  2. opentrons/legacy_commands/helpers.py +59 -1
  3. opentrons/legacy_commands/types.py +30 -0
  4. opentrons/protocol_api/core/engine/instrument.py +182 -115
  5. opentrons/protocol_api/core/engine/pipette_movement_conflict.py +6 -14
  6. opentrons/protocol_api/core/engine/transfer_components_executor.py +30 -25
  7. opentrons/protocol_api/core/instrument.py +8 -4
  8. opentrons/protocol_api/core/legacy/legacy_instrument_core.py +9 -30
  9. opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py +8 -4
  10. opentrons/protocol_api/core/well.py +1 -1
  11. opentrons/protocol_api/instrument_context.py +144 -73
  12. opentrons/protocol_api/labware.py +26 -44
  13. opentrons/protocol_api/protocol_context.py +18 -16
  14. opentrons/protocol_engine/commands/__init__.py +38 -38
  15. opentrons/protocol_engine/commands/aspirate_while_tracking.py +38 -65
  16. opentrons/protocol_engine/commands/command_unions.py +33 -33
  17. opentrons/protocol_engine/commands/dispense_while_tracking.py +36 -72
  18. opentrons/protocol_engine/commands/labware_handling_common.py +6 -1
  19. opentrons/protocol_engine/commands/liquid_probe.py +1 -2
  20. opentrons/protocol_engine/commands/move_to_well.py +5 -11
  21. opentrons/protocol_engine/commands/{evotip_dispense.py → pressure_dispense.py} +27 -27
  22. opentrons/protocol_engine/commands/{evotip_seal_pipette.py → seal_pipette_to_tip.py} +32 -27
  23. opentrons/protocol_engine/commands/{evotip_unseal_pipette.py → unseal_pipette_from_tip.py} +22 -22
  24. opentrons/protocol_engine/execution/pipetting.py +1 -0
  25. opentrons/protocol_engine/labware_offset_standardization.py +22 -1
  26. opentrons/protocol_engine/resources/deck_configuration_provider.py +8 -4
  27. opentrons/protocol_engine/state/frustum_helpers.py +12 -4
  28. opentrons/protocol_engine/state/geometry.py +121 -72
  29. opentrons/protocol_engine/state/update_types.py +1 -1
  30. opentrons/protocol_engine/state/wells.py +1 -1
  31. opentrons/protocol_engine/types/__init__.py +6 -0
  32. opentrons/protocol_engine/types/well_position.py +18 -1
  33. opentrons/protocols/advanced_control/transfers/transfer_liquid_utils.py +1 -1
  34. opentrons/protocols/labware.py +23 -18
  35. opentrons/util/logging_config.py +94 -25
  36. opentrons/util/logging_queue_handler.py +61 -0
  37. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/METADATA +4 -4
  38. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/RECORD +42 -41
  39. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/LICENSE +0 -0
  40. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/WHEEL +0 -0
  41. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/entry_points.txt +0 -0
  42. {opentrons-8.4.0a3.dist-info → opentrons-8.4.0a5.dist-info}/top_level.txt +0 -0
@@ -99,6 +99,14 @@ class TipState:
99
99
  ), "Last air gap volume doe not match the volume being removed"
100
100
  self.last_liquid_and_air_gap_in_tip.air_gap = 0
101
101
 
102
+ def delete_last_air_gap_and_liquid(self) -> None:
103
+ air_gap_in_tip = self.last_liquid_and_air_gap_in_tip.air_gap
104
+ liquid_in_tip = self.last_liquid_and_air_gap_in_tip.liquid
105
+ if air_gap_in_tip:
106
+ self.delete_air_gap(air_gap_in_tip)
107
+ if liquid_in_tip:
108
+ self.delete_liquid(volume=liquid_in_tip)
109
+
102
110
 
103
111
  class TransferType(Enum):
104
112
  ONE_TO_ONE = "one_to_one"
@@ -180,7 +188,6 @@ class TransferComponentsExecutor:
180
188
  # TODO: do volume configuration + prepare for aspirate only if the mode needs to be changed
181
189
  self._instrument.configure_for_volume(volume_for_pipette_mode_configuration) # type: ignore[arg-type]
182
190
  self._instrument.prepare_to_aspirate()
183
-
184
191
  tx_utils.raise_if_location_inside_liquid(
185
192
  location=submerge_start_location,
186
193
  well_location=self._target_location,
@@ -207,8 +214,7 @@ class TransferComponentsExecutor:
207
214
  minimum_z_height=None,
208
215
  speed=submerge_properties.speed,
209
216
  )
210
- if submerge_properties.delay.enabled:
211
- assert submerge_properties.delay.duration is not None
217
+ if submerge_properties.delay.enabled and submerge_properties.delay.duration:
212
218
  self._instrument.delay(submerge_properties.delay.duration)
213
219
 
214
220
  def aspirate_and_wait(self, volume: float) -> None:
@@ -227,9 +233,7 @@ class TransferComponentsExecutor:
227
233
  )
228
234
  self._tip_state.append_liquid(volume)
229
235
  delay_props = aspirate_props.delay
230
- if delay_props.enabled:
231
- # Assertion only for mypy purposes
232
- assert delay_props.duration is not None
236
+ if delay_props.enabled and delay_props.duration:
233
237
  self._instrument.delay(delay_props.duration)
234
238
 
235
239
  def dispense_and_wait(
@@ -257,8 +261,7 @@ class TransferComponentsExecutor:
257
261
  self._tip_state.ready_to_aspirate = False
258
262
  self._tip_state.delete_liquid(volume)
259
263
  dispense_delay = dispense_properties.delay
260
- if dispense_delay.enabled:
261
- assert dispense_delay.duration is not None
264
+ if dispense_delay.enabled and dispense_delay.duration:
262
265
  self._instrument.delay(dispense_delay.duration)
263
266
 
264
267
  def mix(self, mix_properties: MixProperties, last_dispense_push_out: bool) -> None:
@@ -361,8 +364,7 @@ class TransferComponentsExecutor:
361
364
  speed=retract_props.speed,
362
365
  )
363
366
  retract_delay = retract_props.delay
364
- if retract_delay.enabled:
365
- assert retract_delay.duration is not None
367
+ if retract_delay.enabled and retract_delay.duration:
366
368
  self._instrument.delay(retract_delay.duration)
367
369
  touch_tip_props = retract_props.touch_tip
368
370
  if touch_tip_props.enabled:
@@ -459,8 +461,7 @@ class TransferComponentsExecutor:
459
461
  speed=retract_props.speed,
460
462
  )
461
463
  retract_delay = retract_props.delay
462
- if retract_delay.enabled:
463
- assert retract_delay.duration is not None
464
+ if retract_delay.enabled and retract_delay.duration:
464
465
  self._instrument.delay(retract_delay.duration)
465
466
 
466
467
  blowout_props = retract_props.blowout
@@ -532,6 +533,9 @@ class TransferComponentsExecutor:
532
533
  if isinstance(trash_location, Location)
533
534
  else None
534
535
  )
536
+ # A non-multi-dispense blowout will only have air and maybe droplets in the tip
537
+ # since we only blowout after dispensing the full tip contents.
538
+ # So delete the air gap from tip state
535
539
  last_air_gap = self._tip_state.last_liquid_and_air_gap_in_tip.air_gap
536
540
  self._tip_state.delete_air_gap(last_air_gap)
537
541
  self._tip_state.ready_to_aspirate = False
@@ -599,8 +603,7 @@ class TransferComponentsExecutor:
599
603
  speed=retract_props.speed,
600
604
  )
601
605
  retract_delay = retract_props.delay
602
- if retract_delay.enabled:
603
- assert retract_delay.duration is not None
606
+ if retract_delay.enabled and retract_delay.duration:
604
607
  self._instrument.delay(retract_delay.duration)
605
608
 
606
609
  blowout_props = retract_props.blowout
@@ -616,6 +619,10 @@ class TransferComponentsExecutor:
616
619
  well_core=None,
617
620
  in_place=True,
618
621
  )
622
+ # A blowout will remove all air gap and liquid (disposal volume) from the tip
623
+ # so delete them from tip state (although practically, there will not be
624
+ # any air gaps in the tip before blowing out in the destination well)
625
+ self._tip_state.delete_last_air_gap_and_liquid()
619
626
  self._tip_state.ready_to_aspirate = False
620
627
 
621
628
  # A retract will perform total of two air gaps if we need to blow out in source or trash:
@@ -703,8 +710,9 @@ class TransferComponentsExecutor:
703
710
  if isinstance(trash_location, Location)
704
711
  else None
705
712
  )
706
- last_air_gap = self._tip_state.last_liquid_and_air_gap_in_tip.air_gap
707
- self._tip_state.delete_air_gap(last_air_gap)
713
+ # A blowout will remove all air gap and liquid (disposal volume) from the tip
714
+ # so delete them from tip state
715
+ self._tip_state.delete_last_air_gap_and_liquid()
708
716
  self._tip_state.ready_to_aspirate = False
709
717
 
710
718
  # Do touch tip and air gap again after blowing out into source well or trash
@@ -780,8 +788,8 @@ class TransferComponentsExecutor:
780
788
  correction_volume = aspirate_props.correction_by_volume.get_for_volume(
781
789
  air_gap_volume
782
790
  )
783
- # The maximum flow rate should be air_gap_volume per second
784
- flow_rate = min(
791
+ # The minimum flow rate should be air_gap_volume per second
792
+ flow_rate = max(
785
793
  aspirate_props.flow_rate_by_volume.get_for_volume(air_gap_volume),
786
794
  air_gap_volume,
787
795
  )
@@ -791,9 +799,7 @@ class TransferComponentsExecutor:
791
799
  correction_volume=correction_volume,
792
800
  )
793
801
  delay_props = aspirate_props.delay
794
- if delay_props.enabled:
795
- # Assertion only for mypy purposes
796
- assert delay_props.duration is not None
802
+ if delay_props.enabled and delay_props.duration:
797
803
  self._instrument.delay(delay_props.duration)
798
804
  self._tip_state.append_air_gap(air_gap_volume)
799
805
 
@@ -807,8 +813,8 @@ class TransferComponentsExecutor:
807
813
  correction_volume = dispense_props.correction_by_volume.get_for_volume(
808
814
  last_air_gap
809
815
  )
810
- # The maximum flow rate should be air_gap_volume per second
811
- flow_rate = min(
816
+ # The minimum flow rate should be air_gap_volume per second
817
+ flow_rate = max(
812
818
  dispense_props.flow_rate_by_volume.get_for_volume(last_air_gap),
813
819
  last_air_gap,
814
820
  )
@@ -824,8 +830,7 @@ class TransferComponentsExecutor:
824
830
  )
825
831
  self._tip_state.delete_air_gap(last_air_gap)
826
832
  dispense_delay = dispense_props.delay
827
- if dispense_delay.enabled:
828
- assert dispense_delay.duration is not None
833
+ if dispense_delay.enabled and dispense_delay.duration:
829
834
  self._instrument.delay(dispense_delay.duration)
830
835
 
831
836
 
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from abc import abstractmethod, ABC
6
- from typing import Any, Generic, Optional, TypeVar, Union, List, Tuple
6
+ from typing import Any, Generic, Optional, TypeVar, Union, List, Tuple, Literal
7
7
 
8
8
  from opentrons import types
9
9
  from opentrons.hardware_control.dev_types import PipetteDict
@@ -11,7 +11,7 @@ from opentrons.protocols.api_support.util import FlowRates
11
11
  from opentrons.protocols.advanced_control.transfers.common import TransferTipPolicyV2
12
12
  from opentrons.protocol_api._nozzle_layout import NozzleLayout
13
13
  from opentrons.protocol_api._liquid import LiquidClass
14
- from opentrons.protocol_engine.types.liquid_level_detection import LiquidTrackingType
14
+ from opentrons.protocol_engine.types import LiquidTrackingType
15
15
 
16
16
  from ..disposal_locations import TrashBin, WasteChute
17
17
  from .well import WellCoreType
@@ -190,6 +190,7 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
190
190
  force_direct: bool,
191
191
  minimum_z_height: Optional[float],
192
192
  speed: Optional[float],
193
+ check_for_movement_conflicts: bool,
193
194
  ) -> None:
194
195
  ...
195
196
 
@@ -367,6 +368,7 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
367
368
  dest: List[Tuple[types.Location, WellCoreType]],
368
369
  new_tip: TransferTipPolicyV2,
369
370
  tip_racks: List[Tuple[types.Location, LabwareCoreType]],
371
+ starting_tip: Optional[WellCoreType],
370
372
  trash_location: Union[types.Location, TrashBin, WasteChute],
371
373
  return_tip: bool,
372
374
  ) -> None:
@@ -380,8 +382,9 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
380
382
  volume: float,
381
383
  source: Tuple[types.Location, WellCoreType],
382
384
  dest: List[Tuple[types.Location, WellCoreType]],
383
- new_tip: TransferTipPolicyV2,
385
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
384
386
  tip_racks: List[Tuple[types.Location, LabwareCoreType]],
387
+ starting_tip: Optional[WellCoreType],
385
388
  trash_location: Union[types.Location, TrashBin, WasteChute],
386
389
  return_tip: bool,
387
390
  ) -> None:
@@ -398,8 +401,9 @@ class AbstractInstrument(ABC, Generic[WellCoreType, LabwareCoreType]):
398
401
  volume: float,
399
402
  source: List[Tuple[types.Location, WellCoreType]],
400
403
  dest: Tuple[types.Location, WellCoreType],
401
- new_tip: TransferTipPolicyV2,
404
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
402
405
  tip_racks: List[Tuple[types.Location, LabwareCoreType]],
406
+ starting_tip: Optional[WellCoreType],
403
407
  trash_location: Union[types.Location, TrashBin, WasteChute],
404
408
  return_tip: bool,
405
409
  ) -> None:
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
- from typing import TYPE_CHECKING, Optional, Union, List, Tuple
4
+ from typing import TYPE_CHECKING, Optional, Union, List, Tuple, Literal
5
5
 
6
6
  from opentrons import types
7
7
  from opentrons.hardware_control import CriticalPoint
@@ -22,7 +22,7 @@ from opentrons.protocols.geometry import planning
22
22
  from opentrons.protocol_api._nozzle_layout import NozzleLayout
23
23
  from opentrons.protocol_api._liquid import LiquidClass
24
24
 
25
- from opentrons.protocol_engine.types.liquid_level_detection import LiquidTrackingType
25
+ from opentrons.protocol_engine.types import LiquidTrackingType
26
26
 
27
27
  from ...disposal_locations import TrashBin, WasteChute
28
28
  from ..instrument import AbstractInstrument
@@ -367,6 +367,7 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
367
367
  force_direct: bool = False,
368
368
  minimum_z_height: Optional[float] = None,
369
369
  speed: Optional[float] = None,
370
+ check_for_movement_conflicts: bool = False,
370
371
  ) -> None:
371
372
  """Move the instrument.
372
373
 
@@ -376,6 +377,7 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
376
377
  force_direct: Force a direct movement instead of an arc.
377
378
  minimum_z_height: Set a minimum travel height for a movement arc.
378
379
  speed: Override the travel speed in mm/s.
380
+ check_for_movement_conflicts: Not used in legacy implementation
379
381
 
380
382
  Raises:
381
383
  LabwareHeightError: An item on the deck is taller than
@@ -438,32 +440,6 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
438
440
  location=location, mount=location_cache_mount
439
441
  )
440
442
 
441
- def evotip_seal(
442
- self,
443
- location: types.Location,
444
- well_core: LegacyWellCore,
445
- in_place: Optional[bool] = False,
446
- ) -> None:
447
- """This will never be called because it was added in API 2.22."""
448
- assert False, "evotip_seal only supported in API 2.22 & later"
449
-
450
- def evotip_unseal(
451
- self, location: types.Location, well_core: WellCore, home_after: Optional[bool]
452
- ) -> None:
453
- """This will never be called because it was added in API 2.22."""
454
- assert False, "evotip_unseal only supported in API 2.22 & later"
455
-
456
- def evotip_dispense(
457
- self,
458
- location: types.Location,
459
- well_core: WellCore,
460
- volume: Optional[float] = None,
461
- flow_rate: Optional[float] = None,
462
- push_out: Optional[float] = None,
463
- ) -> None:
464
- """This will never be called because it was added in API 2.22."""
465
- assert False, "evotip_dispense only supported in API 2.22 & later"
466
-
467
443
  def get_mount(self) -> types.Mount:
468
444
  """Get the mount this pipette is attached to."""
469
445
  return self._mount
@@ -632,6 +608,7 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
632
608
  dest: List[Tuple[types.Location, LegacyWellCore]],
633
609
  new_tip: TransferTipPolicyV2,
634
610
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
611
+ starting_tip: Optional[LegacyWellCore],
635
612
  trash_location: Union[types.Location, TrashBin, WasteChute],
636
613
  return_tip: bool,
637
614
  ) -> None:
@@ -644,8 +621,9 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
644
621
  volume: float,
645
622
  source: Tuple[types.Location, LegacyWellCore],
646
623
  dest: List[Tuple[types.Location, LegacyWellCore]],
647
- new_tip: TransferTipPolicyV2,
624
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
648
625
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
626
+ starting_tip: Optional[LegacyWellCore],
649
627
  trash_location: Union[types.Location, TrashBin, WasteChute],
650
628
  return_tip: bool,
651
629
  ) -> None:
@@ -658,8 +636,9 @@ class LegacyInstrumentCore(AbstractInstrument[LegacyWellCore, LegacyLabwareCore]
658
636
  volume: float,
659
637
  source: List[Tuple[types.Location, LegacyWellCore]],
660
638
  dest: Tuple[types.Location, LegacyWellCore],
661
- new_tip: TransferTipPolicyV2,
639
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
662
640
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
641
+ starting_tip: Optional[LegacyWellCore],
663
642
  trash_location: Union[types.Location, TrashBin, WasteChute],
664
643
  return_tip: bool,
665
644
  ) -> None:
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
- from typing import TYPE_CHECKING, Optional, Union, List, Tuple
4
+ from typing import TYPE_CHECKING, Optional, Union, List, Tuple, Literal
5
5
 
6
6
  from opentrons import types
7
7
  from opentrons.hardware_control.dev_types import PipetteDict
@@ -23,7 +23,7 @@ from opentrons_shared_data.errors.exceptions import (
23
23
  UnexpectedTipAttachError,
24
24
  )
25
25
 
26
- from opentrons.protocol_engine.types.liquid_level_detection import LiquidTrackingType
26
+ from opentrons.protocol_engine.types import LiquidTrackingType
27
27
 
28
28
  from ..legacy.legacy_labware_core import LegacyLabwareCore
29
29
  from ...disposal_locations import TrashBin, WasteChute
@@ -325,6 +325,7 @@ class LegacyInstrumentCoreSimulator(
325
325
  force_direct: bool = False,
326
326
  minimum_z_height: Optional[float] = None,
327
327
  speed: Optional[float] = None,
328
+ check_for_movement_conflicts: bool = False, # Not used in this implementation
328
329
  ) -> None:
329
330
  """Simulation of only the motion planning portion of move_to."""
330
331
  if isinstance(location, (TrashBin, WasteChute)):
@@ -521,6 +522,7 @@ class LegacyInstrumentCoreSimulator(
521
522
  dest: List[Tuple[types.Location, LegacyWellCore]],
522
523
  new_tip: TransferTipPolicyV2,
523
524
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
525
+ starting_tip: Optional[LegacyWellCore],
524
526
  trash_location: Union[types.Location, TrashBin, WasteChute],
525
527
  return_tip: bool,
526
528
  ) -> None:
@@ -533,8 +535,9 @@ class LegacyInstrumentCoreSimulator(
533
535
  volume: float,
534
536
  source: Tuple[types.Location, LegacyWellCore],
535
537
  dest: List[Tuple[types.Location, LegacyWellCore]],
536
- new_tip: TransferTipPolicyV2,
538
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
537
539
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
540
+ starting_tip: Optional[LegacyWellCore],
538
541
  trash_location: Union[types.Location, TrashBin, WasteChute],
539
542
  return_tip: bool,
540
543
  ) -> None:
@@ -547,8 +550,9 @@ class LegacyInstrumentCoreSimulator(
547
550
  volume: float,
548
551
  source: List[Tuple[types.Location, LegacyWellCore]],
549
552
  dest: Tuple[types.Location, LegacyWellCore],
550
- new_tip: TransferTipPolicyV2,
553
+ new_tip: Literal[TransferTipPolicyV2.NEVER, TransferTipPolicyV2.ONCE],
551
554
  tip_racks: List[Tuple[types.Location, LegacyLabwareCore]],
555
+ starting_tip: Optional[LegacyWellCore],
552
556
  trash_location: Union[types.Location, TrashBin, WasteChute],
553
557
  return_tip: bool,
554
558
  ) -> None:
@@ -4,7 +4,7 @@ from abc import ABC, abstractmethod
4
4
  from typing import TypeVar, Optional, Union
5
5
 
6
6
  from opentrons.types import Point
7
- from opentrons.protocol_engine.types.liquid_level_detection import LiquidTrackingType
7
+ from opentrons.protocol_engine.types import LiquidTrackingType
8
8
 
9
9
  from .._liquid import Liquid
10
10