opentrons 8.7.0a2__py3-none-any.whl → 8.7.0a3__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.

Potentially problematic release.


This version of opentrons might be problematic. Click here for more details.

Files changed (119) hide show
  1. opentrons/_version.py +2 -2
  2. opentrons/drivers/thermocycler/abstract.py +0 -1
  3. opentrons/drivers/thermocycler/driver.py +4 -33
  4. opentrons/drivers/thermocycler/simulator.py +0 -2
  5. opentrons/hardware_control/api.py +5 -24
  6. opentrons/hardware_control/backends/controller.py +2 -8
  7. opentrons/hardware_control/backends/ot3controller.py +0 -3
  8. opentrons/hardware_control/backends/ot3simulator.py +1 -2
  9. opentrons/hardware_control/backends/simulator.py +1 -2
  10. opentrons/hardware_control/backends/subsystem_manager.py +2 -5
  11. opentrons/hardware_control/module_control.py +8 -82
  12. opentrons/hardware_control/modules/__init__.py +0 -3
  13. opentrons/hardware_control/modules/absorbance_reader.py +4 -11
  14. opentrons/hardware_control/modules/flex_stacker.py +9 -38
  15. opentrons/hardware_control/modules/heater_shaker.py +5 -30
  16. opentrons/hardware_control/modules/magdeck.py +4 -8
  17. opentrons/hardware_control/modules/mod_abc.py +5 -13
  18. opentrons/hardware_control/modules/tempdeck.py +5 -25
  19. opentrons/hardware_control/modules/thermocycler.py +10 -56
  20. opentrons/hardware_control/modules/types.py +1 -20
  21. opentrons/hardware_control/modules/utils.py +4 -11
  22. opentrons/hardware_control/nozzle_manager.py +0 -3
  23. opentrons/hardware_control/ot3api.py +5 -26
  24. opentrons/hardware_control/scripts/update_module_fw.py +0 -5
  25. opentrons/hardware_control/types.py +2 -31
  26. opentrons/legacy_commands/protocol_commands.py +0 -20
  27. opentrons/legacy_commands/types.py +0 -42
  28. opentrons/motion_planning/waypoints.py +29 -15
  29. opentrons/protocol_api/__init__.py +0 -5
  30. opentrons/protocol_api/_types.py +1 -6
  31. opentrons/protocol_api/core/common.py +1 -3
  32. opentrons/protocol_api/core/engine/_default_labware_versions.py +11 -32
  33. opentrons/protocol_api/core/engine/labware.py +1 -8
  34. opentrons/protocol_api/core/engine/module_core.py +0 -4
  35. opentrons/protocol_api/core/engine/protocol.py +43 -23
  36. opentrons/protocol_api/core/legacy/legacy_module_core.py +0 -2
  37. opentrons/protocol_api/core/legacy/legacy_protocol_core.py +1 -11
  38. opentrons/protocol_api/core/legacy_simulator/legacy_protocol_core.py +2 -14
  39. opentrons/protocol_api/core/module.py +0 -1
  40. opentrons/protocol_api/core/protocol.py +2 -11
  41. opentrons/protocol_api/module_contexts.py +0 -1
  42. opentrons/protocol_api/protocol_context.py +4 -26
  43. opentrons/protocol_api/robot_context.py +21 -38
  44. opentrons/protocol_api/validation.py +1 -6
  45. opentrons/protocol_engine/actions/__init__.py +2 -4
  46. opentrons/protocol_engine/actions/actions.py +9 -22
  47. opentrons/protocol_engine/clients/sync_client.py +7 -6
  48. opentrons/protocol_engine/commands/__init__.py +0 -42
  49. opentrons/protocol_engine/commands/absorbance_reader/close_lid.py +15 -2
  50. opentrons/protocol_engine/commands/absorbance_reader/open_lid.py +15 -2
  51. opentrons/protocol_engine/commands/aspirate.py +0 -1
  52. opentrons/protocol_engine/commands/command.py +0 -1
  53. opentrons/protocol_engine/commands/command_unions.py +0 -39
  54. opentrons/protocol_engine/commands/dispense.py +0 -1
  55. opentrons/protocol_engine/commands/drop_tip.py +8 -32
  56. opentrons/protocol_engine/commands/movement_common.py +0 -2
  57. opentrons/protocol_engine/commands/pick_up_tip.py +11 -21
  58. opentrons/protocol_engine/commands/thermocycler/run_extended_profile.py +0 -6
  59. opentrons/protocol_engine/commands/thermocycler/run_profile.py +0 -8
  60. opentrons/protocol_engine/commands/thermocycler/set_target_block_temperature.py +1 -17
  61. opentrons/protocol_engine/commands/touch_tip.py +1 -1
  62. opentrons/protocol_engine/commands/unsafe/unsafe_place_labware.py +22 -6
  63. opentrons/protocol_engine/errors/__init__.py +0 -4
  64. opentrons/protocol_engine/errors/exceptions.py +0 -55
  65. opentrons/protocol_engine/execution/__init__.py +0 -2
  66. opentrons/protocol_engine/execution/command_executor.py +0 -8
  67. opentrons/protocol_engine/execution/create_queue_worker.py +1 -5
  68. opentrons/protocol_engine/execution/labware_movement.py +12 -9
  69. opentrons/protocol_engine/execution/movement.py +0 -2
  70. opentrons/protocol_engine/execution/queue_worker.py +0 -4
  71. opentrons/protocol_engine/execution/run_control.py +0 -8
  72. opentrons/protocol_engine/protocol_engine.py +33 -67
  73. opentrons/protocol_engine/resources/__init__.py +0 -2
  74. opentrons/protocol_engine/resources/deck_configuration_provider.py +0 -7
  75. opentrons/protocol_engine/resources/labware_validation.py +6 -10
  76. opentrons/protocol_engine/state/_labware_origin_math.py +636 -0
  77. opentrons/protocol_engine/state/_well_math.py +18 -60
  78. opentrons/protocol_engine/state/addressable_areas.py +0 -2
  79. opentrons/protocol_engine/state/commands.py +7 -7
  80. opentrons/protocol_engine/state/geometry.py +374 -204
  81. opentrons/protocol_engine/state/labware.py +102 -52
  82. opentrons/protocol_engine/state/module_substates/thermocycler_module_substate.py +0 -37
  83. opentrons/protocol_engine/state/modules.py +8 -21
  84. opentrons/protocol_engine/state/motion.py +0 -44
  85. opentrons/protocol_engine/state/state.py +0 -14
  86. opentrons/protocol_engine/state/state_summary.py +0 -2
  87. opentrons/protocol_engine/state/tips.py +258 -177
  88. opentrons/protocol_engine/state/update_types.py +9 -16
  89. opentrons/protocol_engine/types/__init__.py +3 -9
  90. opentrons/protocol_engine/types/deck_configuration.py +1 -5
  91. opentrons/protocol_engine/types/instrument.py +1 -8
  92. opentrons/protocol_engine/types/labware.py +13 -1
  93. opentrons/protocol_engine/types/module.py +0 -10
  94. opentrons/protocol_engine/types/tip.py +0 -9
  95. opentrons/protocol_runner/create_simulating_orchestrator.py +2 -29
  96. opentrons/protocol_runner/run_orchestrator.py +2 -18
  97. opentrons/protocols/api_support/definitions.py +1 -1
  98. opentrons/protocols/api_support/types.py +1 -2
  99. opentrons/simulate.py +15 -48
  100. opentrons/system/camera.py +1 -1
  101. {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a3.dist-info}/METADATA +4 -4
  102. {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a3.dist-info}/RECORD +105 -118
  103. opentrons/protocol_api/core/engine/tasks.py +0 -35
  104. opentrons/protocol_api/core/legacy/tasks.py +0 -19
  105. opentrons/protocol_api/core/legacy_simulator/tasks.py +0 -19
  106. opentrons/protocol_api/core/tasks.py +0 -31
  107. opentrons/protocol_api/tasks.py +0 -48
  108. opentrons/protocol_engine/commands/create_timer.py +0 -83
  109. opentrons/protocol_engine/commands/set_tip_state.py +0 -97
  110. opentrons/protocol_engine/commands/wait_for_tasks.py +0 -98
  111. opentrons/protocol_engine/execution/task_handler.py +0 -157
  112. opentrons/protocol_engine/resources/concurrency_provider.py +0 -27
  113. opentrons/protocol_engine/state/labware_origin_math/errors.py +0 -94
  114. opentrons/protocol_engine/state/labware_origin_math/stackup_origin_to_labware_origin.py +0 -1331
  115. opentrons/protocol_engine/state/tasks.py +0 -139
  116. opentrons/protocol_engine/types/tasks.py +0 -38
  117. {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a3.dist-info}/WHEEL +0 -0
  118. {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a3.dist-info}/entry_points.txt +0 -0
  119. {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a3.dist-info}/licenses/LICENSE +0 -0
@@ -59,6 +59,7 @@ from .actions import (
59
59
  AddAddressableAreaAction,
60
60
  AddModuleAction,
61
61
  HardwareStoppedAction,
62
+ ResetTipsAction,
62
63
  SetPipetteMovementSpeedAction,
63
64
  )
64
65
 
@@ -321,10 +322,24 @@ class ProtocolEngine:
321
322
  )
322
323
  return completed_command
323
324
 
324
- def _stop_from_asynchronous_error(self) -> None:
325
+ def estop(self) -> None:
326
+ """Signal to the engine that an E-stop event occurred.
327
+
328
+ If an estop happens while the robot is moving, lower layers physically stop
329
+ motion and raise the event as an exception, which fails the Protocol Engine
330
+ command. No action from the `ProtocolEngine` caller is needed to handle that.
331
+
332
+ However, if an estop happens in between commands, or in the middle of
333
+ a command like `comment` or `waitForDuration` that doesn't access the hardware,
334
+ `ProtocolEngine` needs to be told about it so it can interrupt the command
335
+ and stop executing any more. This method is how to do that.
336
+
337
+ This acts roughly like `request_stop()`. After calling this, you should call
338
+ `finish()` with an EStopActivatedError.
339
+ """
325
340
  try:
326
341
  action = self._state_store.commands.validate_action_allowed(
327
- StopAction(from_asynchronous_error=True)
342
+ StopAction(from_estop=True)
328
343
  )
329
344
  except Exception: # todo(mm, 2024-04-16): Catch a more specific type.
330
345
  # This is likely called from some hardware API callback that doesn't care
@@ -343,72 +358,9 @@ class ProtocolEngine:
343
358
  # do this because we want to make sure non-hardware commands, like
344
359
  # `waitForDuration`, are also interrupted.
345
360
  self._get_queue_worker.cancel()
346
-
347
- def estop(self) -> None:
348
- """Signal to the engine that an E-stop event occurred.
349
-
350
- If an estop happens while the robot is moving, lower layers physically stop
351
- motion and raise the event as an exception, which fails the Protocol Engine
352
- command. No action from the `ProtocolEngine` caller is needed to handle that.
353
-
354
- However, if an estop happens in between commands, or in the middle of
355
- a command like `comment` or `waitForDuration` that doesn't access the hardware,
356
- `ProtocolEngine` needs to be told about it so it can interrupt the command
357
- and stop executing any more. This method is how to do that.
358
-
359
- This acts roughly like `request_stop()`. After calling this, you should call
360
- `finish()` with an EStopActivatedError.
361
- """
362
361
  # Unlike self.request_stop(), we don't need to do
363
362
  # self._hardware_api.cancel_execution_and_running_tasks(). Since this was an
364
363
  # E-stop event, the hardware API already knows.
365
- self._stop_from_asynchronous_error()
366
-
367
- async def async_module_error(
368
- self, module_model: ModuleModel, serial: str | None
369
- ) -> bool:
370
- """Signal to the engine that an asynchronous module error occured.
371
-
372
- The return value of this function signals whether the error is relevant to the protocol
373
- or not. If the function returns True, the error is relevant. The engine will stop, and
374
- the caller should call `finish()` with the error object that signaled the error. If
375
- the function returns False, the error is not relevant. The engine will not stop, and the
376
- caller should not call `finish()`.
377
-
378
- Asynchronous module errors are signaled when a module enters a hardware error state
379
- - for instance, a thermocycler's thermistors fail because of condensation, or a
380
- heater-shaker's wires fray and snap, or a module is accidentally disconnected. These
381
- errors are not related to a particular command, even a currently-happening module
382
- control command for the module in the error state.
383
-
384
- Similar to an estop error, the error can occur at any time relative to the lifecycle
385
- of the engine run or of any particular command.
386
-
387
- Unlike an estop, the motion control hardware will not be raising an error and will not
388
- stop on its own; the stop action derived from this call will do that.
389
- """
390
- if not self._state_store.modules.get_has_module_probably_matching_hardware_details(
391
- module_model, serial
392
- ):
393
- return False
394
- self._stop_from_asynchronous_error()
395
- # like self.request_stop, and unlike self.estop(), we must explicitly request that the
396
- # hardware stops execution, since not all asynchronous errors will cause the hardware
397
- # to know that it should stop.
398
- await self._do_hardware_stop()
399
- return True
400
-
401
- async def _do_hardware_stop(self) -> None:
402
- """Make the hardware stop now."""
403
- if self._hardware_api.is_movement_execution_taskified():
404
- # We 'taskify' hardware controller movement functions when running protocols
405
- # that are not backed by the engine. Such runs cannot be stopped by cancelling
406
- # the queue worker and hence need to be stopped via the execution manager.
407
- # `cancel_execution_and_running_tasks()` sets the execution manager in a CANCELLED state
408
- # and cancels the running tasks, which raises an error and gets us out of the
409
- # run function execution, just like `_queue_worker.cancel()` does for
410
- # engine-backed runs.
411
- await self._hardware_api.cancel_execution_and_running_tasks()
412
364
 
413
365
  async def request_stop(self) -> None:
414
366
  """Make command execution stop soon.
@@ -426,7 +378,15 @@ class ProtocolEngine:
426
378
  action = self._state_store.commands.validate_action_allowed(StopAction())
427
379
  self._action_dispatcher.dispatch(action)
428
380
  self._get_queue_worker.cancel()
429
- await self._do_hardware_stop()
381
+ if self._hardware_api.is_movement_execution_taskified():
382
+ # We 'taskify' hardware controller movement functions when running protocols
383
+ # that are not backed by the engine. Such runs cannot be stopped by cancelling
384
+ # the queue worker and hence need to be stopped via the execution manager.
385
+ # `cancel_execution_and_running_tasks()` sets the execution manager in a CANCELLED state
386
+ # and cancels the running tasks, which raises an error and gets us out of the
387
+ # run function execution, just like `_queue_worker.cancel()` does for
388
+ # engine-backed runs.
389
+ await self._hardware_api.cancel_execution_and_running_tasks()
430
390
 
431
391
  async def wait_until_complete(self) -> None:
432
392
  """Wait until there are no more commands to execute.
@@ -469,7 +429,7 @@ class ProtocolEngine:
469
429
  post_run_hardware_state: The state in which to leave the gantry and motors in
470
430
  after the run is over.
471
431
  """
472
- if self._state_store.commands.get_is_stopped_by_async_error():
432
+ if self._state_store.commands.get_is_stopped_by_estop():
473
433
  # This handles the case where the E-stop was pressed while we were *not* in the middle
474
434
  # of some hardware interaction that would raise it as an exception. For example, imagine
475
435
  # we were paused between two commands, or imagine we were executing a waitForDuration.
@@ -626,6 +586,12 @@ class ProtocolEngine:
626
586
  AddAddressableAreaAction(addressable_area_name)
627
587
  )
628
588
 
589
+ def reset_tips(self, labware_id: str) -> None:
590
+ """Reset the tip state of a given labware."""
591
+ # TODO(mm, 2023-03-10): Safely raise an error if the given labware isn't a
592
+ # tip rack?
593
+ self._action_dispatcher.dispatch(ResetTipsAction(labware_id=labware_id))
594
+
629
595
  # TODO(mm, 2022-11-10): This is a method on ProtocolEngine instead of a command
630
596
  # as a quick hack to support Python protocols. We should consider making this a
631
597
  # command, or adding speed parameters to existing commands.
@@ -11,7 +11,6 @@ from .labware_data_provider import LabwareDataProvider
11
11
  from .module_data_provider import ModuleDataProvider
12
12
  from .file_provider import FileProvider
13
13
  from .ot3_validation import ensure_ot3_hardware
14
- from .concurrency_provider import ConcurrencyProvider
15
14
 
16
15
 
17
16
  __all__ = [
@@ -19,7 +18,6 @@ __all__ = [
19
18
  "LabwareDataProvider",
20
19
  "DeckDataProvider",
21
20
  "DeckFixedLabware",
22
- "ConcurrencyProvider",
23
21
  "ModuleDataProvider",
24
22
  "FileProvider",
25
23
  "ensure_ot3_hardware",
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Set, Tuple
4
4
 
5
- from opentrons_shared_data.module.types import ModuleOrientation
6
5
  from opentrons_shared_data.deck.types import (
7
6
  DeckDefinitionV5,
8
7
  CutoutFixture,
@@ -125,11 +124,6 @@ def get_addressable_area_from_name(
125
124
  z=addressable_area["boundingBox"]["zDimension"],
126
125
  )
127
126
  features = addressable_area["features"]
128
- orientation = (
129
- addressable_area["orientation"]
130
- if addressable_area["orientation"]
131
- else ModuleOrientation.NOT_APPLICABLE
132
- )
133
127
  mating_surface_unit_vector = addressable_area.get("matingSurfaceUnitVector")
134
128
 
135
129
  return AddressableArea(
@@ -144,7 +138,6 @@ def get_addressable_area_from_name(
144
138
  "compatibleModuleTypes", []
145
139
  ),
146
140
  features=features,
147
- orientation=orientation,
148
141
  )
149
142
  raise AddressableAreaDoesNotExistError(
150
143
  f"Could not find addressable area with name {addressable_area_name}"
@@ -2,7 +2,6 @@
2
2
 
3
3
  from opentrons_shared_data.labware.labware_definition import (
4
4
  LabwareDefinition,
5
- LabwareDefinition2,
6
5
  LabwareRole,
7
6
  )
8
7
 
@@ -45,18 +44,15 @@ def validate_definition_is_system(definition: LabwareDefinition) -> bool:
45
44
  return LabwareRole.system in definition.allowedRoles
46
45
 
47
46
 
48
- def validate_legacy_labware_can_be_stacked(
49
- child_labware_definition: LabwareDefinition2, parent_labware_load_name: str
47
+ def validate_labware_can_be_stacked(
48
+ top_labware_definition: LabwareDefinition, below_labware_load_name: str
50
49
  ) -> bool:
51
- """Validate that the parent labware is in the child labware's stackingOffsetWithLabware definition.
52
-
53
- Schema 3 Labware stacking validation is handled in locating features.
54
- """
50
+ """Validate that the labware being loaded onto is in the above labware's stackingOffsetWithLabware definition."""
55
51
  return (
56
- parent_labware_load_name in child_labware_definition.stackingOffsetWithLabware
52
+ below_labware_load_name in top_labware_definition.stackingOffsetWithLabware
57
53
  or (
58
- "default" in child_labware_definition.stackingOffsetWithLabware
59
- and child_labware_definition.compatibleParentLabware is None
54
+ "default" in top_labware_definition.stackingOffsetWithLabware
55
+ and top_labware_definition.compatibleParentLabware is None
60
56
  )
61
57
  )
62
58