opentrons 8.7.0a7__py3-none-any.whl → 8.7.0a9__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 (147) hide show
  1. opentrons/_version.py +2 -2
  2. opentrons/drivers/asyncio/communication/serial_connection.py +55 -129
  3. opentrons/drivers/flex_stacker/driver.py +6 -1
  4. opentrons/drivers/heater_shaker/abstract.py +0 -5
  5. opentrons/drivers/heater_shaker/driver.py +0 -10
  6. opentrons/drivers/heater_shaker/simulator.py +0 -4
  7. opentrons/drivers/thermocycler/abstract.py +0 -6
  8. opentrons/drivers/thermocycler/driver.py +10 -61
  9. opentrons/drivers/thermocycler/simulator.py +0 -6
  10. opentrons/hardware_control/api.py +5 -24
  11. opentrons/hardware_control/backends/controller.py +2 -8
  12. opentrons/hardware_control/backends/flex_protocol.py +1 -0
  13. opentrons/hardware_control/backends/ot3controller.py +3 -3
  14. opentrons/hardware_control/backends/ot3simulator.py +2 -2
  15. opentrons/hardware_control/backends/simulator.py +1 -2
  16. opentrons/hardware_control/backends/subsystem_manager.py +2 -5
  17. opentrons/hardware_control/emulation/abstract_emulator.py +4 -6
  18. opentrons/hardware_control/emulation/connection_handler.py +5 -8
  19. opentrons/hardware_control/emulation/heater_shaker.py +3 -12
  20. opentrons/hardware_control/emulation/settings.py +1 -1
  21. opentrons/hardware_control/emulation/thermocycler.py +15 -67
  22. opentrons/hardware_control/module_control.py +8 -82
  23. opentrons/hardware_control/modules/__init__.py +0 -3
  24. opentrons/hardware_control/modules/absorbance_reader.py +4 -11
  25. opentrons/hardware_control/modules/flex_stacker.py +9 -38
  26. opentrons/hardware_control/modules/heater_shaker.py +5 -42
  27. opentrons/hardware_control/modules/magdeck.py +4 -8
  28. opentrons/hardware_control/modules/mod_abc.py +5 -13
  29. opentrons/hardware_control/modules/tempdeck.py +5 -25
  30. opentrons/hardware_control/modules/thermocycler.py +11 -68
  31. opentrons/hardware_control/modules/types.py +1 -20
  32. opentrons/hardware_control/modules/utils.py +4 -11
  33. opentrons/hardware_control/nozzle_manager.py +0 -3
  34. opentrons/hardware_control/ot3api.py +7 -26
  35. opentrons/hardware_control/poller.py +8 -22
  36. opentrons/hardware_control/protocols/gripper_controller.py +1 -0
  37. opentrons/hardware_control/scripts/update_module_fw.py +0 -5
  38. opentrons/hardware_control/types.py +2 -31
  39. opentrons/legacy_commands/module_commands.py +0 -23
  40. opentrons/legacy_commands/protocol_commands.py +0 -20
  41. opentrons/legacy_commands/types.py +0 -80
  42. opentrons/motion_planning/deck_conflict.py +12 -17
  43. opentrons/motion_planning/waypoints.py +29 -15
  44. opentrons/protocol_api/__init__.py +1 -5
  45. opentrons/protocol_api/_types.py +1 -6
  46. opentrons/protocol_api/core/common.py +1 -3
  47. opentrons/protocol_api/core/engine/_default_labware_versions.py +11 -32
  48. opentrons/protocol_api/core/engine/labware.py +1 -8
  49. opentrons/protocol_api/core/engine/module_core.py +8 -75
  50. opentrons/protocol_api/core/engine/protocol.py +1 -18
  51. opentrons/protocol_api/core/engine/well.py +0 -8
  52. opentrons/protocol_api/core/legacy/legacy_module_core.py +4 -24
  53. opentrons/protocol_api/core/legacy/legacy_protocol_core.py +1 -11
  54. opentrons/protocol_api/core/legacy/legacy_well_core.py +0 -4
  55. opentrons/protocol_api/core/legacy_simulator/legacy_protocol_core.py +2 -14
  56. opentrons/protocol_api/core/module.py +4 -37
  57. opentrons/protocol_api/core/protocol.py +2 -11
  58. opentrons/protocol_api/core/well.py +0 -4
  59. opentrons/protocol_api/labware.py +0 -5
  60. opentrons/protocol_api/module_contexts.py +61 -122
  61. opentrons/protocol_api/protocol_context.py +4 -26
  62. opentrons/protocol_api/robot_context.py +21 -38
  63. opentrons/protocol_api/validation.py +1 -6
  64. opentrons/protocol_engine/actions/__init__.py +2 -4
  65. opentrons/protocol_engine/actions/actions.py +9 -22
  66. opentrons/protocol_engine/clients/sync_client.py +7 -42
  67. opentrons/protocol_engine/commands/__init__.py +0 -42
  68. opentrons/protocol_engine/commands/absorbance_reader/close_lid.py +15 -2
  69. opentrons/protocol_engine/commands/absorbance_reader/open_lid.py +15 -2
  70. opentrons/protocol_engine/commands/aspirate.py +0 -1
  71. opentrons/protocol_engine/commands/command.py +0 -1
  72. opentrons/protocol_engine/commands/command_unions.py +0 -49
  73. opentrons/protocol_engine/commands/dispense.py +0 -1
  74. opentrons/protocol_engine/commands/drop_tip.py +8 -32
  75. opentrons/protocol_engine/commands/heater_shaker/__init__.py +0 -14
  76. opentrons/protocol_engine/commands/heater_shaker/set_and_wait_for_shake_speed.py +4 -5
  77. opentrons/protocol_engine/commands/heater_shaker/set_target_temperature.py +5 -31
  78. opentrons/protocol_engine/commands/movement_common.py +0 -2
  79. opentrons/protocol_engine/commands/pick_up_tip.py +11 -21
  80. opentrons/protocol_engine/commands/temperature_module/set_target_temperature.py +7 -38
  81. opentrons/protocol_engine/commands/thermocycler/__init__.py +0 -16
  82. opentrons/protocol_engine/commands/thermocycler/run_extended_profile.py +0 -6
  83. opentrons/protocol_engine/commands/thermocycler/run_profile.py +0 -8
  84. opentrons/protocol_engine/commands/thermocycler/set_target_block_temperature.py +6 -40
  85. opentrons/protocol_engine/commands/thermocycler/set_target_lid_temperature.py +5 -29
  86. opentrons/protocol_engine/commands/touch_tip.py +1 -1
  87. opentrons/protocol_engine/commands/unsafe/unsafe_place_labware.py +22 -6
  88. opentrons/protocol_engine/errors/__init__.py +0 -4
  89. opentrons/protocol_engine/errors/exceptions.py +0 -55
  90. opentrons/protocol_engine/execution/__init__.py +0 -2
  91. opentrons/protocol_engine/execution/command_executor.py +0 -8
  92. opentrons/protocol_engine/execution/create_queue_worker.py +1 -5
  93. opentrons/protocol_engine/execution/labware_movement.py +21 -10
  94. opentrons/protocol_engine/execution/movement.py +0 -2
  95. opentrons/protocol_engine/execution/queue_worker.py +0 -4
  96. opentrons/protocol_engine/execution/run_control.py +0 -8
  97. opentrons/protocol_engine/protocol_engine.py +34 -75
  98. opentrons/protocol_engine/resources/__init__.py +0 -2
  99. opentrons/protocol_engine/resources/deck_configuration_provider.py +0 -7
  100. opentrons/protocol_engine/resources/labware_validation.py +6 -10
  101. opentrons/protocol_engine/state/_labware_origin_math.py +636 -0
  102. opentrons/protocol_engine/state/_well_math.py +18 -60
  103. opentrons/protocol_engine/state/addressable_areas.py +0 -2
  104. opentrons/protocol_engine/state/commands.py +11 -14
  105. opentrons/protocol_engine/state/geometry.py +374 -213
  106. opentrons/protocol_engine/state/labware.py +102 -52
  107. opentrons/protocol_engine/state/module_substates/thermocycler_module_substate.py +0 -37
  108. opentrons/protocol_engine/state/modules.py +8 -21
  109. opentrons/protocol_engine/state/motion.py +0 -44
  110. opentrons/protocol_engine/state/state.py +0 -14
  111. opentrons/protocol_engine/state/state_summary.py +0 -2
  112. opentrons/protocol_engine/state/tips.py +258 -177
  113. opentrons/protocol_engine/state/update_types.py +9 -16
  114. opentrons/protocol_engine/types/__init__.py +3 -9
  115. opentrons/protocol_engine/types/deck_configuration.py +1 -5
  116. opentrons/protocol_engine/types/instrument.py +1 -8
  117. opentrons/protocol_engine/types/labware.py +13 -1
  118. opentrons/protocol_engine/types/module.py +0 -10
  119. opentrons/protocol_engine/types/tip.py +0 -9
  120. opentrons/protocol_runner/create_simulating_orchestrator.py +2 -29
  121. opentrons/protocol_runner/run_orchestrator.py +2 -18
  122. opentrons/protocols/api_support/definitions.py +1 -1
  123. opentrons/protocols/api_support/types.py +1 -2
  124. opentrons/simulate.py +15 -48
  125. opentrons/system/camera.py +1 -1
  126. {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/METADATA +4 -4
  127. {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/RECORD +130 -146
  128. opentrons/protocol_api/core/engine/tasks.py +0 -48
  129. opentrons/protocol_api/core/legacy/tasks.py +0 -19
  130. opentrons/protocol_api/core/legacy_simulator/tasks.py +0 -19
  131. opentrons/protocol_api/core/tasks.py +0 -31
  132. opentrons/protocol_api/tasks.py +0 -48
  133. opentrons/protocol_engine/commands/create_timer.py +0 -83
  134. opentrons/protocol_engine/commands/heater_shaker/common.py +0 -20
  135. opentrons/protocol_engine/commands/heater_shaker/set_shake_speed.py +0 -136
  136. opentrons/protocol_engine/commands/set_tip_state.py +0 -97
  137. opentrons/protocol_engine/commands/thermocycler/start_run_extended_profile.py +0 -191
  138. opentrons/protocol_engine/commands/wait_for_tasks.py +0 -98
  139. opentrons/protocol_engine/execution/task_handler.py +0 -157
  140. opentrons/protocol_engine/resources/concurrency_provider.py +0 -27
  141. opentrons/protocol_engine/state/labware_origin_math/errors.py +0 -94
  142. opentrons/protocol_engine/state/labware_origin_math/stackup_origin_to_labware_origin.py +0 -1331
  143. opentrons/protocol_engine/state/tasks.py +0 -139
  144. opentrons/protocol_engine/types/tasks.py +0 -38
  145. {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/WHEEL +0 -0
  146. {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/entry_points.txt +0 -0
  147. {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/licenses/LICENSE +0 -0
@@ -6,10 +6,7 @@ from enum import Enum
6
6
 
7
7
  from opentrons.types import DeckSlotName
8
8
 
9
- from opentrons_shared_data.module.types import (
10
- ModuleType as SharedDataModuleType,
11
- ModuleOrientation,
12
- )
9
+ from opentrons_shared_data.module.types import ModuleType as SharedDataModuleType
13
10
  from opentrons_shared_data.deck.types import SlotDefV3
14
11
  from opentrons_shared_data.labware.types import LocatingFeatures
15
12
 
@@ -60,7 +57,6 @@ class AddressableArea:
60
57
  position: AddressableOffsetVector
61
58
  compatible_module_types: List[SharedDataModuleType]
62
59
  features: LocatingFeatures
63
- orientation: ModuleOrientation
64
60
 
65
61
 
66
62
  # TODO make the below some sort of better type
@@ -1,5 +1,5 @@
1
1
  """Protocol Engine types to do with instruments."""
2
- import enum
2
+
3
3
  from typing import Union
4
4
 
5
5
  from dataclasses import dataclass
@@ -45,10 +45,3 @@ class InstrumentOffsetVector(BaseModel):
45
45
  x: float
46
46
  y: float
47
47
  z: float
48
-
49
-
50
- class GripperMoveType(enum.Enum):
51
- """Types of gripper movement."""
52
-
53
- PICK_UP_LABWARE = enum.auto()
54
- DROP_LABWARE = enum.auto()
@@ -2,12 +2,16 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Optional, Union
6
6
  from dataclasses import dataclass
7
7
  from datetime import datetime
8
8
 
9
9
  from pydantic import BaseModel, Field
10
10
 
11
+ from opentrons_shared_data.labware.labware_definition import (
12
+ LabwareDefinition,
13
+ )
14
+
11
15
  from .location import LabwareLocation
12
16
  from .labware_offset_location import (
13
17
  LegacyLabwareOffsetLocation,
@@ -15,6 +19,8 @@ from .labware_offset_location import (
15
19
  )
16
20
  from .labware_offset_vector import LabwareOffsetVector
17
21
  from .util import Vec3f
22
+ from .module import ModuleDefinition
23
+ from .deck_configuration import DeckLocationDefinition
18
24
 
19
25
 
20
26
  @dataclass(frozen=True)
@@ -120,6 +126,12 @@ class LoadedLabware(BaseModel):
120
126
  )
121
127
 
122
128
 
129
+ LabwareParentDefinition = Union[
130
+ DeckLocationDefinition, ModuleDefinition, LabwareDefinition
131
+ ]
132
+ """Information pertaining to a labware's parent (deck slot, module, or another labware) location."""
133
+
134
+
123
135
  @dataclass(frozen=True)
124
136
  class LabwareWellId:
125
137
  """Designates a well in a labware."""
@@ -21,7 +21,6 @@ from opentrons_shared_data.labware.types import LocatingFeatures
21
21
 
22
22
  from opentrons.hardware_control.modules import (
23
23
  ModuleType as ModuleType,
24
- ModuleModel as HardwareModuleModel,
25
24
  )
26
25
 
27
26
  from .location import DeckSlotLocation
@@ -44,11 +43,6 @@ class ModuleModel(str, Enum):
44
43
  ABSORBANCE_READER_V1 = "absorbanceReaderV1"
45
44
  FLEX_STACKER_MODULE_V1 = "flexStackerModuleV1"
46
45
 
47
- @classmethod
48
- def from_hardware(cls, hardware_model: HardwareModuleModel) -> "ModuleModel":
49
- """Convert from the hardware model representation."""
50
- return cls(hardware_model.value)
51
-
52
46
  def as_type(self) -> ModuleType:
53
47
  """Get the ModuleType of this model."""
54
48
  if ModuleModel.is_temperature_module_model(self):
@@ -199,10 +193,6 @@ class ModuleDefinition(BaseModel):
199
193
  ...,
200
194
  )
201
195
 
202
- orientation: Dict[str, str] = Field(
203
- ...,
204
- )
205
-
206
196
  compatibleWith: List[ModuleModel] = Field(
207
197
  ...,
208
198
  )
@@ -1,7 +1,6 @@
1
1
  """Protocol Engine types to deal with tips."""
2
2
 
3
3
  from dataclasses import dataclass
4
- from enum import Enum
5
4
 
6
5
 
7
6
  @dataclass(frozen=True)
@@ -17,11 +16,3 @@ class TipGeometry:
17
16
  length: float
18
17
  diameter: float
19
18
  volume: float
20
-
21
-
22
- class TipRackWellState(Enum):
23
- """The state of a single tip in a tip rack's well."""
24
-
25
- CLEAN = "clean"
26
- USED = "used"
27
- EMPTY = "empty"
@@ -16,38 +16,11 @@ from opentrons_shared_data.robot.types import RobotType
16
16
  from .python_protocol_wrappers import SimulatingContextCreator
17
17
  from .run_orchestrator import RunOrchestrator
18
18
  from .protocol_runner import create_protocol_runner, LiveRunner
19
- from ..protocol_engine.types import (
20
- PostRunHardwareState,
21
- )
22
-
23
-
24
- class SimulatingRunOrchestrator(RunOrchestrator):
25
- """A RunOrchestrator that cleans up its simulating hardware controller.
26
-
27
- This should only be created and returned by create_simulating_orchestrator, unless
28
- you are sure it's appropriate to clean up the hardware controller.
29
- """
30
-
31
- async def finish(
32
- self,
33
- error: Exception | None = None,
34
- drop_tips_after_run: bool = True,
35
- set_run_status: bool = True,
36
- post_run_hardware_state: PostRunHardwareState = PostRunHardwareState.HOME_AND_STAY_ENGAGED,
37
- ) -> None:
38
- """Finish the run and clean up the simulating hardware controller."""
39
- await super().finish(
40
- error=error,
41
- drop_tips_after_run=drop_tips_after_run,
42
- set_run_status=set_run_status,
43
- post_run_hardware_state=post_run_hardware_state,
44
- )
45
- await self._hardware_api.clean_up()
46
19
 
47
20
 
48
21
  async def create_simulating_orchestrator(
49
22
  robot_type: RobotType, protocol_config: ProtocolConfig
50
- ) -> SimulatingRunOrchestrator:
23
+ ) -> RunOrchestrator:
51
24
  """Create a RunOrchestrator wired to a simulating HardwareControlAPI.
52
25
 
53
26
  Example:
@@ -123,7 +96,7 @@ async def create_simulating_orchestrator(
123
96
  hardware_api=simulating_hardware_api,
124
97
  )
125
98
 
126
- return SimulatingRunOrchestrator(
99
+ return RunOrchestrator(
127
100
  hardware_api=simulating_hardware_api,
128
101
  json_or_python_protocol_runner=runner,
129
102
  protocol_engine=protocol_engine,
@@ -15,10 +15,7 @@ from opentrons_shared_data.robot.types import RobotType
15
15
 
16
16
  from . import protocol_runner, RunResult, JsonRunner, PythonAndLegacyRunner
17
17
  from ..hardware_control import HardwareControlAPI
18
- from ..hardware_control.modules import (
19
- AbstractModule as HardwareModuleAPI,
20
- ModuleModel as HardwareModuleModel,
21
- )
18
+ from ..hardware_control.modules import AbstractModule as HardwareModuleAPI
22
19
  from ..protocol_engine import (
23
20
  ProtocolEngine,
24
21
  CommandCreate,
@@ -88,6 +85,7 @@ class RunOrchestrator:
88
85
  def __init__(
89
86
  self,
90
87
  protocol_engine: ProtocolEngine,
88
+ # todo(mm, 2024-07-05): This hardware_api param looks unused?
91
89
  hardware_api: HardwareControlAPI,
92
90
  fixit_runner: protocol_runner.LiveRunner,
93
91
  setup_runner: protocol_runner.LiveRunner,
@@ -117,8 +115,6 @@ class RunOrchestrator:
117
115
  self._fixit_runner.prepare()
118
116
  self._setup_runner.prepare()
119
117
  self._protocol_engine.set_and_start_queue_worker(self.command_generator)
120
- # used by SimulatingRunOrchestrator to clean up the simulating hardware controller
121
- self._hardware_api = hardware_api
122
118
 
123
119
  @property
124
120
  def run_id(self) -> str:
@@ -384,18 +380,6 @@ class RunOrchestrator:
384
380
  """Handle an E-stop event from the hardware API."""
385
381
  return self._protocol_engine.estop()
386
382
 
387
- async def asynchronous_module_error(
388
- self, module_model: HardwareModuleModel, module_serial: str | None
389
- ) -> bool:
390
- """Handle an asynchronous module error reported by hardware.
391
-
392
- If this function returns true, the caller should call finish() immediately; if it returns
393
- False, the caller should not call finish() until it otherwise would.
394
- """
395
- return await self._protocol_engine.async_module_error(
396
- module_model=ModuleModel.from_hardware(module_model), serial=module_serial
397
- )
398
-
399
383
  async def use_attached_modules(
400
384
  self, modules_by_id: Dict[str, HardwareModuleAPI]
401
385
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  from .types import APIVersion
2
2
 
3
- MAX_SUPPORTED_VERSION = APIVersion(2, 27)
3
+ MAX_SUPPORTED_VERSION = APIVersion(2, 26)
4
4
  """The maximum supported protocol API version in this release."""
5
5
 
6
6
  MIN_SUPPORTED_VERSION = APIVersion(2, 0)
@@ -1,5 +1,5 @@
1
1
  from __future__ import annotations
2
- from typing import NamedTuple, TypedDict, Optional
2
+ from typing import NamedTuple, TypedDict
3
3
 
4
4
 
5
5
  class APIVersion(NamedTuple):
@@ -30,4 +30,3 @@ class ThermocyclerStep(ThermocyclerStepBase, total=False):
30
30
 
31
31
  hold_time_seconds: float
32
32
  hold_time_minutes: float
33
- ramp_rate: Optional[float]
opentrons/simulate.py CHANGED
@@ -3,7 +3,6 @@
3
3
  This module has functions that provide a console entrypoint for simulating
4
4
  a protocol from the command line.
5
5
  """
6
-
7
6
  import argparse
8
7
  import asyncio
9
8
  import atexit
@@ -25,7 +24,6 @@ from typing import (
25
24
  BinaryIO,
26
25
  Optional,
27
26
  Union,
28
- Iterator,
29
27
  )
30
28
  from typing_extensions import Literal
31
29
 
@@ -83,7 +81,6 @@ if TYPE_CHECKING:
83
81
  from opentrons_shared_data.labware.types import (
84
82
  LabwareDefinition as LabwareDefinitionDict,
85
83
  )
86
- from opentrons.protocol_engine import ProtocolEngine
87
84
 
88
85
 
89
86
  # See Jira RCORE-535.
@@ -312,7 +309,6 @@ def get_protocol_api(
312
309
  bundled_labware=bundled_labware,
313
310
  bundled_data=bundled_data,
314
311
  extra_labware=extra_labware,
315
- clean_up_hardware=(hardware_simulator is None),
316
312
  )
317
313
  else:
318
314
  if bundled_labware is not None:
@@ -330,7 +326,6 @@ def get_protocol_api(
330
326
  bundled_data=bundled_data,
331
327
  extra_labware=extra_labware,
332
328
  use_pe_virtual_hardware=use_virtual_hardware,
333
- clean_up_hardware=(hardware_simulator is None),
334
329
  )
335
330
 
336
331
  # Intentional difference from execute.get_protocol_api():
@@ -786,15 +781,13 @@ def _create_live_context_non_pe(
786
781
  extra_labware: Optional[Dict[str, "LabwareDefinitionDict"]],
787
782
  bundled_labware: Optional[Dict[str, "LabwareDefinitionDict"]],
788
783
  bundled_data: Optional[Dict[str, bytes]],
789
- clean_up_hardware: bool,
790
784
  ) -> ProtocolContext:
791
785
  """Return a live ProtocolContext.
792
786
 
793
787
  This controls the robot through the older infrastructure, instead of through Protocol Engine.
794
788
  """
795
789
  assert api_version < ENGINE_CORE_API_VERSION
796
-
797
- ctx = protocol_api.create_protocol_context(
790
+ return protocol_api.create_protocol_context(
798
791
  api_version=api_version,
799
792
  deck_type=deck_type,
800
793
  hardware_api=hardware_api,
@@ -802,17 +795,6 @@ def _create_live_context_non_pe(
802
795
  bundled_data=bundled_data,
803
796
  extra_labware=extra_labware,
804
797
  )
805
- # Hack: we need to hook the protocol context cleanup in a way that isn't safe to put
806
- # in the context generally, so we can do it like this and feel sad
807
- original_cleanup = ctx.cleanup
808
-
809
- def _cleanup_hook() -> None:
810
- if clean_up_hardware:
811
- ctx._hw_manager.hardware.clean_up()
812
- original_cleanup()
813
-
814
- ctx.cleanup = _cleanup_hook # type: ignore[method-assign]
815
- return ctx
816
798
 
817
799
 
818
800
  def _create_live_context_pe(
@@ -823,40 +805,26 @@ def _create_live_context_pe(
823
805
  extra_labware: Dict[str, "LabwareDefinitionDict"],
824
806
  bundled_data: Optional[Dict[str, bytes]],
825
807
  use_pe_virtual_hardware: bool = True,
826
- clean_up_hardware: bool = True,
827
808
  ) -> ProtocolContext:
828
809
  """Return a live ProtocolContext that controls the robot through ProtocolEngine."""
829
810
  assert api_version >= ENGINE_CORE_API_VERSION
830
811
  hardware_api_wrapped = hardware_api.wrapped()
831
812
  global _LIVE_PROTOCOL_ENGINE_CONTEXTS
832
-
833
- @contextmanager
834
- def _cleanup_hardware_with_engine() -> (
835
- Iterator[tuple["ProtocolEngine", asyncio.AbstractEventLoop]]
836
- ):
837
-
838
- try:
839
- with create_protocol_engine_in_thread(
840
- hardware_api=hardware_api_wrapped,
841
- config=_get_protocol_engine_config(
842
- robot_type, use_pe_virtual_hardware=use_pe_virtual_hardware
843
- ),
844
- deck_configuration=None,
845
- file_provider=None,
846
- error_recovery_policy=error_recovery_policy.never_recover,
847
- drop_tips_after_run=False,
848
- post_run_hardware_state=PostRunHardwareState.STAY_ENGAGED_IN_PLACE,
849
- load_fixed_trash=should_load_fixed_trash_labware_for_python_protocol(
850
- api_version
851
- ),
852
- ) as (engine, loop):
853
- yield engine, loop
854
- finally:
855
- if clean_up_hardware:
856
- hardware_api.clean_up()
857
-
858
813
  pe, loop = _LIVE_PROTOCOL_ENGINE_CONTEXTS.enter_context(
859
- _cleanup_hardware_with_engine()
814
+ create_protocol_engine_in_thread(
815
+ hardware_api=hardware_api_wrapped,
816
+ config=_get_protocol_engine_config(
817
+ robot_type, use_pe_virtual_hardware=use_pe_virtual_hardware
818
+ ),
819
+ deck_configuration=None,
820
+ file_provider=None,
821
+ error_recovery_policy=error_recovery_policy.never_recover,
822
+ drop_tips_after_run=False,
823
+ post_run_hardware_state=PostRunHardwareState.STAY_ENGAGED_IN_PLACE,
824
+ load_fixed_trash=should_load_fixed_trash_labware_for_python_protocol(
825
+ api_version
826
+ ),
827
+ )
860
828
  )
861
829
 
862
830
  # `async def` so we can use loop.run_coroutine_threadsafe() to wait for its completion.
@@ -911,7 +879,6 @@ def _run_file_non_pe(
911
879
  extra_labware=extra_labware,
912
880
  bundled_labware=bundled_labware,
913
881
  bundled_data=bundled_data,
914
- clean_up_hardware=False,
915
882
  )
916
883
 
917
884
  scraper = _CommandScraper(logger=logger, level=level, broker=context.broker)
@@ -30,7 +30,7 @@ async def take_picture(filename: Path) -> None:
30
30
  pass
31
31
 
32
32
  if ARCHITECTURE == SystemArchitecture.YOCTO:
33
- cmd = f"v4l2-ctl --device /dev/ot_system_camera --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --stream-to={str(filename)} --stream-count=1"
33
+ cmd = f"v4l2-ctl --device /dev/video2 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --stream-to={str(filename)} --stream-count=1"
34
34
  elif ARCHITECTURE == SystemArchitecture.BUILDROOT:
35
35
  cmd = f"ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:1 -frames 1 {str(filename)}"
36
36
  else: # HOST
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opentrons
3
- Version: 8.7.0a7
3
+ Version: 8.7.0a9
4
4
  Summary: The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.
5
5
  Project-URL: opentrons.com, https://www.opentrons.com
6
6
  Project-URL: Source Code On Github, https://github.com/Opentrons/opentrons/tree/edge/api
@@ -24,7 +24,7 @@ Requires-Dist: click<9,>=8.0.0
24
24
  Requires-Dist: importlib-metadata>=1.0; python_version < '3.8'
25
25
  Requires-Dist: jsonschema<4.18.0,>=3.0.1
26
26
  Requires-Dist: numpy<2,>=1.20.0
27
- Requires-Dist: opentrons-shared-data==8.7.0a7
27
+ Requires-Dist: opentrons-shared-data==8.7.0a9
28
28
  Requires-Dist: packaging>=21.0
29
29
  Requires-Dist: pydantic-settings<3,>=2
30
30
  Requires-Dist: pydantic<3,>=2.0.0
@@ -32,6 +32,6 @@ Requires-Dist: pyserial>=3.5
32
32
  Requires-Dist: pyusb==1.2.1
33
33
  Requires-Dist: typing-extensions<5,>=4.0.0
34
34
  Provides-Extra: flex-hardware
35
- Requires-Dist: opentrons-hardware[flex]==8.7.0a7; extra == 'flex-hardware'
35
+ Requires-Dist: opentrons-hardware[flex]==8.7.0a9; extra == 'flex-hardware'
36
36
  Provides-Extra: ot2-hardware
37
- Requires-Dist: opentrons-hardware==8.7.0a7; extra == 'ot2-hardware'
37
+ Requires-Dist: opentrons-hardware==8.7.0a9; extra == 'ot2-hardware'