opentrons 8.7.0a2__py3-none-any.whl → 8.7.0a4__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/thermocycler/abstract.py +0 -1
- opentrons/drivers/thermocycler/driver.py +4 -33
- opentrons/drivers/thermocycler/simulator.py +0 -2
- opentrons/hardware_control/api.py +5 -24
- opentrons/hardware_control/backends/controller.py +2 -8
- opentrons/hardware_control/backends/ot3controller.py +0 -3
- opentrons/hardware_control/backends/ot3simulator.py +1 -2
- opentrons/hardware_control/backends/simulator.py +1 -2
- opentrons/hardware_control/backends/subsystem_manager.py +2 -5
- 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 -30
- 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 +10 -56
- 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 +5 -26
- opentrons/hardware_control/scripts/update_module_fw.py +0 -5
- opentrons/hardware_control/types.py +2 -31
- opentrons/legacy_commands/protocol_commands.py +0 -20
- opentrons/legacy_commands/types.py +0 -42
- opentrons/motion_planning/waypoints.py +29 -15
- opentrons/protocol_api/__init__.py +0 -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 +0 -4
- opentrons/protocol_api/core/engine/protocol.py +43 -23
- opentrons/protocol_api/core/legacy/legacy_module_core.py +0 -2
- opentrons/protocol_api/core/legacy/legacy_protocol_core.py +1 -11
- opentrons/protocol_api/core/legacy_simulator/legacy_protocol_core.py +2 -14
- opentrons/protocol_api/core/module.py +0 -1
- opentrons/protocol_api/core/protocol.py +2 -11
- opentrons/protocol_api/module_contexts.py +0 -1
- 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 -6
- 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 -39
- opentrons/protocol_engine/commands/dispense.py +0 -1
- opentrons/protocol_engine/commands/drop_tip.py +8 -32
- opentrons/protocol_engine/commands/movement_common.py +0 -2
- opentrons/protocol_engine/commands/pick_up_tip.py +11 -21
- 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 +1 -17
- 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 +12 -9
- 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 +33 -67
- 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 +7 -7
- opentrons/protocol_engine/state/geometry.py +374 -204
- 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.0a2.dist-info → opentrons-8.7.0a4.dist-info}/METADATA +4 -4
- {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a4.dist-info}/RECORD +105 -118
- opentrons/protocol_api/core/engine/tasks.py +0 -35
- 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/set_tip_state.py +0 -97
- 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.0a2.dist-info → opentrons-8.7.0a4.dist-info}/WHEEL +0 -0
- {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a4.dist-info}/entry_points.txt +0 -0
- {opentrons-8.7.0a2.dist-info → opentrons-8.7.0a4.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
|
|
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(
|
|
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
|
-
|
|
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.
|
|
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
|
|
49
|
-
|
|
47
|
+
def validate_labware_can_be_stacked(
|
|
48
|
+
top_labware_definition: LabwareDefinition, below_labware_load_name: str
|
|
50
49
|
) -> bool:
|
|
51
|
-
"""Validate that the
|
|
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
|
-
|
|
52
|
+
below_labware_load_name in top_labware_definition.stackingOffsetWithLabware
|
|
57
53
|
or (
|
|
58
|
-
"default" in
|
|
59
|
-
and
|
|
54
|
+
"default" in top_labware_definition.stackingOffsetWithLabware
|
|
55
|
+
and top_labware_definition.compatibleParentLabware is None
|
|
60
56
|
)
|
|
61
57
|
)
|
|
62
58
|
|