1
1
"""Reload labware command request, result, and implementation models."""
2
+
2
3
from __future__ import annotations
3
4
from pydantic import BaseModel , Field
4
5
from typing import TYPE_CHECKING , Optional , Type
5
6
from typing_extensions import Literal
6
7
8
+ from .labware_handling_common import LabwarePositionResultMixin
7
9
from .command import AbstractCommandImpl , BaseCommand , BaseCommandCreate , SuccessData
8
10
from ..errors .error_occurrence import ErrorOccurrence
9
11
from ..state .update_types import StateUpdate
@@ -24,27 +26,9 @@ class ReloadLabwareParams(BaseModel):
24
26
)
25
27
26
28
27
- class ReloadLabwareResult (BaseModel ):
29
+ class ReloadLabwareResult (LabwarePositionResultMixin ):
28
30
"""Result data from the execution of a LoadLabware command."""
29
31
30
- labwareId : str = Field (
31
- ...,
32
- description = "An ID to reference this labware in subsequent commands. Same as the one in the parameters." ,
33
- )
34
- offsetId : Optional [str ] = Field (
35
- # Default `None` instead of `...` so this field shows up as non-required in
36
- # OpenAPI. The server is allowed to omit it or make it null.
37
- None ,
38
- description = (
39
- "An ID referencing the labware offset that will apply"
40
- " to the reloaded labware."
41
- " This offset will be in effect until the labware is moved"
42
- " with a `moveLabware` command."
43
- " Null or undefined means no offset applies,"
44
- " so the default of (0, 0, 0) will be used."
45
- ),
46
- )
47
-
48
32
49
33
class ReloadLabwareImplementation (
50
34
AbstractCommandImpl [ReloadLabwareParams , SuccessData [ReloadLabwareResult ]]
@@ -77,6 +61,9 @@ async def execute(
77
61
public = ReloadLabwareResult (
78
62
labwareId = params .labwareId ,
79
63
offsetId = reloaded_labware .offsetId ,
64
+ locationSequence = self ._state_view .geometry .get_predicted_location_sequence (
65
+ reloaded_labware .location
66
+ ),
80
67
),
81
68
state_update = state_update ,
82
69
)
0 commit comments