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.
- opentrons/_version.py +2 -2
- opentrons/drivers/asyncio/communication/serial_connection.py +55 -129
- opentrons/drivers/flex_stacker/driver.py +6 -1
- opentrons/drivers/heater_shaker/abstract.py +0 -5
- opentrons/drivers/heater_shaker/driver.py +0 -10
- opentrons/drivers/heater_shaker/simulator.py +0 -4
- opentrons/drivers/thermocycler/abstract.py +0 -6
- opentrons/drivers/thermocycler/driver.py +10 -61
- opentrons/drivers/thermocycler/simulator.py +0 -6
- opentrons/hardware_control/api.py +5 -24
- opentrons/hardware_control/backends/controller.py +2 -8
- opentrons/hardware_control/backends/flex_protocol.py +1 -0
- opentrons/hardware_control/backends/ot3controller.py +3 -3
- opentrons/hardware_control/backends/ot3simulator.py +2 -2
- opentrons/hardware_control/backends/simulator.py +1 -2
- opentrons/hardware_control/backends/subsystem_manager.py +2 -5
- opentrons/hardware_control/emulation/abstract_emulator.py +4 -6
- opentrons/hardware_control/emulation/connection_handler.py +5 -8
- opentrons/hardware_control/emulation/heater_shaker.py +3 -12
- opentrons/hardware_control/emulation/settings.py +1 -1
- opentrons/hardware_control/emulation/thermocycler.py +15 -67
- opentrons/hardware_control/module_control.py +8 -82
- opentrons/hardware_control/modules/__init__.py +0 -3
- opentrons/hardware_control/modules/absorbance_reader.py +4 -11
- opentrons/hardware_control/modules/flex_stacker.py +9 -38
- opentrons/hardware_control/modules/heater_shaker.py +5 -42
- opentrons/hardware_control/modules/magdeck.py +4 -8
- opentrons/hardware_control/modules/mod_abc.py +5 -13
- opentrons/hardware_control/modules/tempdeck.py +5 -25
- opentrons/hardware_control/modules/thermocycler.py +11 -68
- opentrons/hardware_control/modules/types.py +1 -20
- opentrons/hardware_control/modules/utils.py +4 -11
- opentrons/hardware_control/nozzle_manager.py +0 -3
- opentrons/hardware_control/ot3api.py +7 -26
- opentrons/hardware_control/poller.py +8 -22
- opentrons/hardware_control/protocols/gripper_controller.py +1 -0
- opentrons/hardware_control/scripts/update_module_fw.py +0 -5
- opentrons/hardware_control/types.py +2 -31
- opentrons/legacy_commands/module_commands.py +0 -23
- opentrons/legacy_commands/protocol_commands.py +0 -20
- opentrons/legacy_commands/types.py +0 -80
- opentrons/motion_planning/deck_conflict.py +12 -17
- opentrons/motion_planning/waypoints.py +29 -15
- opentrons/protocol_api/__init__.py +1 -5
- opentrons/protocol_api/_types.py +1 -6
- opentrons/protocol_api/core/common.py +1 -3
- opentrons/protocol_api/core/engine/_default_labware_versions.py +11 -32
- opentrons/protocol_api/core/engine/labware.py +1 -8
- opentrons/protocol_api/core/engine/module_core.py +8 -75
- opentrons/protocol_api/core/engine/protocol.py +1 -18
- opentrons/protocol_api/core/engine/well.py +0 -8
- opentrons/protocol_api/core/legacy/legacy_module_core.py +4 -24
- opentrons/protocol_api/core/legacy/legacy_protocol_core.py +1 -11
- opentrons/protocol_api/core/legacy/legacy_well_core.py +0 -4
- opentrons/protocol_api/core/legacy_simulator/legacy_protocol_core.py +2 -14
- opentrons/protocol_api/core/module.py +4 -37
- opentrons/protocol_api/core/protocol.py +2 -11
- opentrons/protocol_api/core/well.py +0 -4
- opentrons/protocol_api/labware.py +0 -5
- opentrons/protocol_api/module_contexts.py +61 -122
- opentrons/protocol_api/protocol_context.py +4 -26
- opentrons/protocol_api/robot_context.py +21 -38
- opentrons/protocol_api/validation.py +1 -6
- opentrons/protocol_engine/actions/__init__.py +2 -4
- opentrons/protocol_engine/actions/actions.py +9 -22
- opentrons/protocol_engine/clients/sync_client.py +7 -42
- opentrons/protocol_engine/commands/__init__.py +0 -42
- opentrons/protocol_engine/commands/absorbance_reader/close_lid.py +15 -2
- opentrons/protocol_engine/commands/absorbance_reader/open_lid.py +15 -2
- opentrons/protocol_engine/commands/aspirate.py +0 -1
- opentrons/protocol_engine/commands/command.py +0 -1
- opentrons/protocol_engine/commands/command_unions.py +0 -49
- opentrons/protocol_engine/commands/dispense.py +0 -1
- opentrons/protocol_engine/commands/drop_tip.py +8 -32
- opentrons/protocol_engine/commands/heater_shaker/__init__.py +0 -14
- opentrons/protocol_engine/commands/heater_shaker/set_and_wait_for_shake_speed.py +4 -5
- opentrons/protocol_engine/commands/heater_shaker/set_target_temperature.py +5 -31
- opentrons/protocol_engine/commands/movement_common.py +0 -2
- opentrons/protocol_engine/commands/pick_up_tip.py +11 -21
- opentrons/protocol_engine/commands/temperature_module/set_target_temperature.py +7 -38
- opentrons/protocol_engine/commands/thermocycler/__init__.py +0 -16
- opentrons/protocol_engine/commands/thermocycler/run_extended_profile.py +0 -6
- opentrons/protocol_engine/commands/thermocycler/run_profile.py +0 -8
- opentrons/protocol_engine/commands/thermocycler/set_target_block_temperature.py +6 -40
- opentrons/protocol_engine/commands/thermocycler/set_target_lid_temperature.py +5 -29
- opentrons/protocol_engine/commands/touch_tip.py +1 -1
- opentrons/protocol_engine/commands/unsafe/unsafe_place_labware.py +22 -6
- opentrons/protocol_engine/errors/__init__.py +0 -4
- opentrons/protocol_engine/errors/exceptions.py +0 -55
- opentrons/protocol_engine/execution/__init__.py +0 -2
- opentrons/protocol_engine/execution/command_executor.py +0 -8
- opentrons/protocol_engine/execution/create_queue_worker.py +1 -5
- opentrons/protocol_engine/execution/labware_movement.py +21 -10
- opentrons/protocol_engine/execution/movement.py +0 -2
- opentrons/protocol_engine/execution/queue_worker.py +0 -4
- opentrons/protocol_engine/execution/run_control.py +0 -8
- opentrons/protocol_engine/protocol_engine.py +34 -75
- opentrons/protocol_engine/resources/__init__.py +0 -2
- opentrons/protocol_engine/resources/deck_configuration_provider.py +0 -7
- opentrons/protocol_engine/resources/labware_validation.py +6 -10
- opentrons/protocol_engine/state/_labware_origin_math.py +636 -0
- opentrons/protocol_engine/state/_well_math.py +18 -60
- opentrons/protocol_engine/state/addressable_areas.py +0 -2
- opentrons/protocol_engine/state/commands.py +11 -14
- opentrons/protocol_engine/state/geometry.py +374 -213
- opentrons/protocol_engine/state/labware.py +102 -52
- opentrons/protocol_engine/state/module_substates/thermocycler_module_substate.py +0 -37
- opentrons/protocol_engine/state/modules.py +8 -21
- opentrons/protocol_engine/state/motion.py +0 -44
- opentrons/protocol_engine/state/state.py +0 -14
- opentrons/protocol_engine/state/state_summary.py +0 -2
- opentrons/protocol_engine/state/tips.py +258 -177
- opentrons/protocol_engine/state/update_types.py +9 -16
- opentrons/protocol_engine/types/__init__.py +3 -9
- opentrons/protocol_engine/types/deck_configuration.py +1 -5
- opentrons/protocol_engine/types/instrument.py +1 -8
- opentrons/protocol_engine/types/labware.py +13 -1
- opentrons/protocol_engine/types/module.py +0 -10
- opentrons/protocol_engine/types/tip.py +0 -9
- opentrons/protocol_runner/create_simulating_orchestrator.py +2 -29
- opentrons/protocol_runner/run_orchestrator.py +2 -18
- opentrons/protocols/api_support/definitions.py +1 -1
- opentrons/protocols/api_support/types.py +1 -2
- opentrons/simulate.py +15 -48
- opentrons/system/camera.py +1 -1
- {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/METADATA +4 -4
- {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/RECORD +130 -146
- opentrons/protocol_api/core/engine/tasks.py +0 -48
- opentrons/protocol_api/core/legacy/tasks.py +0 -19
- opentrons/protocol_api/core/legacy_simulator/tasks.py +0 -19
- opentrons/protocol_api/core/tasks.py +0 -31
- opentrons/protocol_api/tasks.py +0 -48
- opentrons/protocol_engine/commands/create_timer.py +0 -83
- opentrons/protocol_engine/commands/heater_shaker/common.py +0 -20
- opentrons/protocol_engine/commands/heater_shaker/set_shake_speed.py +0 -136
- opentrons/protocol_engine/commands/set_tip_state.py +0 -97
- opentrons/protocol_engine/commands/thermocycler/start_run_extended_profile.py +0 -191
- opentrons/protocol_engine/commands/wait_for_tasks.py +0 -98
- opentrons/protocol_engine/execution/task_handler.py +0 -157
- opentrons/protocol_engine/resources/concurrency_provider.py +0 -27
- opentrons/protocol_engine/state/labware_origin_math/errors.py +0 -94
- opentrons/protocol_engine/state/labware_origin_math/stackup_origin_to_labware_origin.py +0 -1331
- opentrons/protocol_engine/state/tasks.py +0 -139
- opentrons/protocol_engine/types/tasks.py +0 -38
- {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/WHEEL +0 -0
- {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/entry_points.txt +0 -0
- {opentrons-8.7.0a7.dist-info → opentrons-8.7.0a9.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"""Task state tracking."""
|
|
2
|
-
from dataclasses import dataclass
|
|
3
|
-
from itertools import chain
|
|
4
|
-
from typing import Iterable
|
|
5
|
-
from ..types import Task, TaskSummary, FinishedTask
|
|
6
|
-
from ._abstract_store import HasState, HandlesActions
|
|
7
|
-
from opentrons.protocol_engine.state import update_types
|
|
8
|
-
from opentrons.protocol_engine.errors.exceptions import NoTaskFoundError
|
|
9
|
-
from ..actions import (
|
|
10
|
-
get_state_updates,
|
|
11
|
-
Action,
|
|
12
|
-
StartTaskAction,
|
|
13
|
-
FinishTaskAction,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@dataclass
|
|
18
|
-
class TaskState:
|
|
19
|
-
"""Task state tracking."""
|
|
20
|
-
|
|
21
|
-
current_tasks_by_id: dict[str, Task]
|
|
22
|
-
finished_tasks_by_id: dict[str, FinishedTask]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class TaskStore(HasState[TaskState], HandlesActions):
|
|
26
|
-
"""Stores tasks."""
|
|
27
|
-
|
|
28
|
-
_state: TaskState
|
|
29
|
-
|
|
30
|
-
def __init__(self) -> None:
|
|
31
|
-
"""Initialize a TaskStore."""
|
|
32
|
-
self._state = TaskState(current_tasks_by_id={}, finished_tasks_by_id={})
|
|
33
|
-
|
|
34
|
-
def _handle_state_update(self, state_update: update_types.StateUpdate) -> None:
|
|
35
|
-
"""Handle a state update."""
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
def _handle_start_task_action(self, action: StartTaskAction) -> None:
|
|
39
|
-
self._state.current_tasks_by_id[action.task.id] = action.task
|
|
40
|
-
|
|
41
|
-
def _handle_finish_task_action(self, action: FinishTaskAction) -> None:
|
|
42
|
-
task = self._state.current_tasks_by_id[action.task_id]
|
|
43
|
-
self._state.finished_tasks_by_id[action.task_id] = FinishedTask(
|
|
44
|
-
id=task.id,
|
|
45
|
-
createdAt=task.createdAt,
|
|
46
|
-
finishedAt=action.finished_at,
|
|
47
|
-
error=action.error,
|
|
48
|
-
)
|
|
49
|
-
del self._state.current_tasks_by_id[action.task_id]
|
|
50
|
-
|
|
51
|
-
def handle_action(self, action: Action) -> None:
|
|
52
|
-
"""Modify the state in reaction to an action."""
|
|
53
|
-
for state_update in get_state_updates(action):
|
|
54
|
-
self._handle_state_update(state_update)
|
|
55
|
-
match action:
|
|
56
|
-
case StartTaskAction():
|
|
57
|
-
self._handle_start_task_action(action)
|
|
58
|
-
case FinishTaskAction():
|
|
59
|
-
self._handle_finish_task_action(action)
|
|
60
|
-
case _:
|
|
61
|
-
pass
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class TaskView:
|
|
65
|
-
"""Read-only task state view."""
|
|
66
|
-
|
|
67
|
-
_state: TaskState
|
|
68
|
-
|
|
69
|
-
def __init__(self, state: TaskState) -> None:
|
|
70
|
-
"""Initialize a TaskView."""
|
|
71
|
-
self._state = state
|
|
72
|
-
|
|
73
|
-
def get_current(self, id: str) -> Task:
|
|
74
|
-
"""Get a task by ID."""
|
|
75
|
-
try:
|
|
76
|
-
return self._state.current_tasks_by_id[id]
|
|
77
|
-
except KeyError as e:
|
|
78
|
-
raise NoTaskFoundError(f"No current task with ID {id}") from e
|
|
79
|
-
|
|
80
|
-
def get_all_current(self) -> list[Task]:
|
|
81
|
-
"""Get all currently running tasks."""
|
|
82
|
-
return [task for task in self._state.current_tasks_by_id.values()]
|
|
83
|
-
|
|
84
|
-
def get_finished(self, id: str) -> FinishedTask:
|
|
85
|
-
"""Get a finished task by ID."""
|
|
86
|
-
try:
|
|
87
|
-
return self._state.finished_tasks_by_id[id]
|
|
88
|
-
except KeyError as e:
|
|
89
|
-
raise NoTaskFoundError(f"No finished task with ID {id}") from e
|
|
90
|
-
|
|
91
|
-
def get(self, id: str) -> Task | FinishedTask:
|
|
92
|
-
"""Get a single task by id."""
|
|
93
|
-
if id in self._state.current_tasks_by_id:
|
|
94
|
-
return self._state.current_tasks_by_id[id]
|
|
95
|
-
elif id in self._state.finished_tasks_by_id:
|
|
96
|
-
return self._state.finished_tasks_by_id[id]
|
|
97
|
-
else:
|
|
98
|
-
raise NoTaskFoundError(message=f"Task {id} not found.")
|
|
99
|
-
|
|
100
|
-
def get_summary(self) -> list[TaskSummary]:
|
|
101
|
-
"""Get a summary of all tasks."""
|
|
102
|
-
return [
|
|
103
|
-
TaskSummary(
|
|
104
|
-
id=task_id,
|
|
105
|
-
createdAt=task.createdAt,
|
|
106
|
-
finishedAt=getattr(task, "finishedAt", None),
|
|
107
|
-
error=getattr(task, "error", None),
|
|
108
|
-
)
|
|
109
|
-
for task_id, task in chain(
|
|
110
|
-
self._state.current_tasks_by_id.items(),
|
|
111
|
-
self._state.finished_tasks_by_id.items(),
|
|
112
|
-
)
|
|
113
|
-
]
|
|
114
|
-
|
|
115
|
-
def all_tasks_finished_or_any_task_failed(self, task_ids: Iterable[str]) -> bool:
|
|
116
|
-
"""Implements wait semantics of asyncio.gather(return_exceptions = False).
|
|
117
|
-
|
|
118
|
-
This returns true when any of the following are true:
|
|
119
|
-
- All tasks in task_ids are complete with or without an error
|
|
120
|
-
- Any task in task_ids is complete with an error.
|
|
121
|
-
|
|
122
|
-
NOTE: Does not raise the error that the errored task has.
|
|
123
|
-
"""
|
|
124
|
-
finished = set(self._state.finished_tasks_by_id.keys())
|
|
125
|
-
task_ids = set(task_ids)
|
|
126
|
-
if task_ids.issubset(finished):
|
|
127
|
-
return True
|
|
128
|
-
if self.get_failed_tasks(task_ids):
|
|
129
|
-
return True
|
|
130
|
-
return False
|
|
131
|
-
|
|
132
|
-
def get_failed_tasks(self, task_ids: Iterable[str]) -> list[str]:
|
|
133
|
-
"""Return a list of failed task ids of the ones that were passed."""
|
|
134
|
-
failed_tasks: list[str] = []
|
|
135
|
-
for task_id in task_ids:
|
|
136
|
-
task = self._state.finished_tasks_by_id.get(task_id, None)
|
|
137
|
-
if task and task.error:
|
|
138
|
-
failed_tasks.append(task_id)
|
|
139
|
-
return failed_tasks
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"""Types for Tasks."""
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
from opentrons.protocol_engine.errors import ErrorOccurrence
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
import asyncio
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@dataclass
|
|
9
|
-
class _BaseTask:
|
|
10
|
-
"""A base task representation."""
|
|
11
|
-
|
|
12
|
-
id: str
|
|
13
|
-
createdAt: datetime
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@dataclass
|
|
17
|
-
class Task(_BaseTask):
|
|
18
|
-
"""A task representation."""
|
|
19
|
-
|
|
20
|
-
asyncioTask: asyncio.Task[None]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@dataclass
|
|
24
|
-
class FinishedTask(_BaseTask):
|
|
25
|
-
"""A finished task representation."""
|
|
26
|
-
|
|
27
|
-
finishedAt: datetime
|
|
28
|
-
error: ErrorOccurrence | None
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@dataclass
|
|
32
|
-
class TaskSummary:
|
|
33
|
-
"""Task info for use in summary lists."""
|
|
34
|
-
|
|
35
|
-
id: str
|
|
36
|
-
createdAt: datetime
|
|
37
|
-
finishedAt: datetime | None = None
|
|
38
|
-
error: ErrorOccurrence | None = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|