Skip to content

Commit 7194892

Browse files
committed
Merge branch 'chore_release-8.5.0' into 850-snapshot-testing
2 parents b202c9d + 9645df8 commit 7194892

File tree

11 files changed

+952
-484
lines changed

11 files changed

+952
-484
lines changed

api/src/opentrons/protocol_api/_liquid_properties.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,28 @@ def position_reference(self) -> PositionReference:
115115
return self._position_reference
116116

117117
@position_reference.setter
118-
def position_reference(self, new_position: str) -> None:
119-
self._position_reference = PositionReference(new_position)
118+
def position_reference(self, new_position: Union[str, PositionReference]) -> None:
119+
self._position_reference = (
120+
new_position
121+
if isinstance(new_position, PositionReference)
122+
else PositionReference(new_position)
123+
)
120124

121125
@property
122126
def offset(self) -> Coordinate:
123127
return self._offset
124128

125129
@offset.setter
126-
def offset(self, new_offset: Sequence[float]) -> None:
127-
x, y, z = validation.validate_coordinates(new_offset)
130+
def offset(self, new_offset: Union[Sequence[float], Coordinate]) -> None:
131+
if isinstance(new_offset, Coordinate):
132+
new_coordinate: Sequence[Union[int, float]] = [
133+
new_offset.x,
134+
new_offset.y,
135+
new_offset.z,
136+
]
137+
else:
138+
new_coordinate = new_offset
139+
x, y, z = validation.validate_coordinates(new_coordinate)
128140
self._offset = Coordinate(x=x, y=y, z=z)
129141

130142
def as_shared_data_model(self) -> SharedDataTipPosition:

app/src/organisms/ErrorRecoveryFlows/utils/__tests__/getErrorKind.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ describe('getErrorKind', () => {
3232
errorType: DEFINED_ERROR_TYPES.OVERPRESSURE,
3333
expectedError: ERROR_KINDS.OVERPRESSURE_WHILE_DISPENSING,
3434
},
35+
{
36+
commandType: 'blowout',
37+
errorType: DEFINED_ERROR_TYPES.OVERPRESSURE,
38+
expectedError: ERROR_KINDS.OVERPRESSURE_WHILE_DISPENSING,
39+
},
40+
{
41+
commandType: 'blowOutInPlace',
42+
errorType: DEFINED_ERROR_TYPES.OVERPRESSURE,
43+
expectedError: ERROR_KINDS.OVERPRESSURE_WHILE_DISPENSING,
44+
},
3545
{
3646
commandType: 'dropTip',
3747
errorType: DEFINED_ERROR_TYPES.TIP_PHYSICALLY_ATTACHED,
Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { ERROR_KINDS, DEFINED_ERROR_TYPES } from '../constants'
2-
3-
import type { ErrorKind } from '../types'
41
import type { FailedCommandBySource } from '/app/organisms/ErrorRecoveryFlows/hooks'
2+
import { DEFINED_ERROR_TYPES, ERROR_KINDS } from '../constants'
3+
import type { ErrorKind } from '../types'
54

65
/**
76
* Given server-side information about a failed command,
@@ -19,45 +18,45 @@ export function getErrorKind(
1918
const errorType = failedCommandByRunRecord?.error?.errorType
2019

2120
if (Boolean(errorIsDefined)) {
22-
if (
23-
commandType === 'prepareToAspirate' &&
24-
errorType === DEFINED_ERROR_TYPES.OVERPRESSURE
25-
) {
26-
return ERROR_KINDS.OVERPRESSURE_PREPARE_TO_ASPIRATE
27-
} else if (
28-
(commandType === 'aspirate' || commandType === 'aspirateInPlace') &&
29-
errorType === DEFINED_ERROR_TYPES.OVERPRESSURE
30-
) {
31-
return ERROR_KINDS.OVERPRESSURE_WHILE_ASPIRATING
32-
} else if (
33-
(commandType === 'dispense' || commandType === 'dispenseInPlace') &&
34-
errorType === DEFINED_ERROR_TYPES.OVERPRESSURE
35-
) {
36-
return ERROR_KINDS.OVERPRESSURE_WHILE_DISPENSING
37-
} else if (
38-
commandType === 'liquidProbe' &&
39-
errorType === DEFINED_ERROR_TYPES.LIQUID_NOT_FOUND
40-
) {
41-
return ERROR_KINDS.NO_LIQUID_DETECTED
42-
} else if (
43-
commandType === 'pickUpTip' &&
44-
errorType === DEFINED_ERROR_TYPES.TIP_PHYSICALLY_MISSING
45-
) {
46-
return ERROR_KINDS.TIP_NOT_DETECTED
47-
} else if (
48-
(commandType === 'dropTip' || commandType === 'dropTipInPlace') &&
49-
errorType === DEFINED_ERROR_TYPES.TIP_PHYSICALLY_ATTACHED
50-
) {
51-
return ERROR_KINDS.TIP_DROP_FAILED
52-
} else if (
53-
commandType === 'moveLabware' &&
54-
errorType === DEFINED_ERROR_TYPES.GRIPPER_MOVEMENT
55-
) {
56-
return ERROR_KINDS.GRIPPER_ERROR
57-
} else if (errorType === DEFINED_ERROR_TYPES.STALL_OR_COLLISION) {
58-
return ERROR_KINDS.STALL_OR_COLLISION
21+
switch (errorType) {
22+
case DEFINED_ERROR_TYPES.OVERPRESSURE:
23+
// The recovery flow varies dependent on the exact failed command.
24+
switch (commandType) {
25+
case 'prepareToAspirate':
26+
return ERROR_KINDS.OVERPRESSURE_PREPARE_TO_ASPIRATE
27+
case 'aspirate':
28+
case 'aspirateInPlace': {
29+
return ERROR_KINDS.OVERPRESSURE_WHILE_ASPIRATING
30+
}
31+
case 'dispense':
32+
case 'dispenseInPlace':
33+
case 'blowout':
34+
case 'blowOutInPlace':
35+
return ERROR_KINDS.OVERPRESSURE_WHILE_DISPENSING
36+
default: {
37+
console.error(`Unhandled overpressure command ${commandType}`)
38+
return ERROR_KINDS.GENERAL_ERROR
39+
}
40+
}
41+
case DEFINED_ERROR_TYPES.LIQUID_NOT_FOUND:
42+
return ERROR_KINDS.NO_LIQUID_DETECTED
43+
case DEFINED_ERROR_TYPES.TIP_PHYSICALLY_MISSING:
44+
return ERROR_KINDS.TIP_NOT_DETECTED
45+
case DEFINED_ERROR_TYPES.TIP_PHYSICALLY_ATTACHED:
46+
return ERROR_KINDS.TIP_DROP_FAILED
47+
case DEFINED_ERROR_TYPES.GRIPPER_MOVEMENT:
48+
return ERROR_KINDS.GRIPPER_ERROR
49+
case DEFINED_ERROR_TYPES.STALL_OR_COLLISION:
50+
return ERROR_KINDS.STALL_OR_COLLISION
51+
default: {
52+
console.error(`Unhandled error type ${errorType}`)
53+
return ERROR_KINDS.GENERAL_ERROR
54+
}
5955
}
56+
} else {
57+
console.warn(
58+
`Run status is "awaiting for recovery", but error is not defined: ${failedCommandByRunRecord}`
59+
)
60+
return ERROR_KINDS.GENERAL_ERROR
6061
}
61-
62-
return ERROR_KINDS.GENERAL_ERROR
6362
}

hardware-testing/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ push-ot3:
216216
$(MAKE) push-plot-webpage-ot3
217217
$(MAKE) push-description-ot3
218218
$(MAKE) push-labware-ot3
219-
cd ../ && $(MAKE) -C shared-data push-ot3
219+
#cd ../ && $(MAKE) -C shared-data push-ot3
220220

221221
.PHONE: open-dev-app
222222
open-dev-app:

hardware-testing/hardware_testing/data/ui.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
"""Production QC User Interface."""
22
from opentrons.hardware_control import SyncHardwareAPI
33
from opentrons.hardware_control.types import StatusBarState
4+
from typing import Optional
45

56
PRINT_HEADER_NUM_SPACES = 4
67
PRINT_HEADER_DASHES = "-" * PRINT_HEADER_NUM_SPACES
78
PRINT_TITLE_POUNDS = "#" * PRINT_HEADER_NUM_SPACES
89
PRINT_HEADER_SPACES = " " * (PRINT_HEADER_NUM_SPACES - 1)
910
PRINT_HEADER_ASTERISK = "*"
1011

12+
outfile: Optional[str] = None
13+
14+
15+
def set_output_file(new_outfile: Optional[str]) -> None:
16+
"""Change the output location of the UI output.
17+
18+
If it is a string it will output to that as a file.
19+
if it is None it will default back to stdout
20+
"""
21+
global outfile
22+
outfile = new_outfile
23+
_output(f"Setting UI output to file {outfile}")
24+
25+
26+
def _output(msg: str) -> None:
27+
global outfile
28+
if outfile:
29+
with open(outfile, "a") as f:
30+
f.write(f"{msg}\n")
31+
else:
32+
print(msg)
33+
1134

1235
def get_user_answer(question: str) -> bool:
1336
"""Get user answer."""
@@ -23,7 +46,9 @@ def get_user_answer(question: str) -> bool:
2346

2447
def get_user_ready(message: str) -> None:
2548
"""Get user ready."""
26-
input(f"WAIT: {message}, press ENTER when ready: ")
49+
global outfile
50+
if not outfile:
51+
input(f"WAIT: {message}, press ENTER when ready: ")
2752

2853

2954
def alert_user_ready(message: str, hw: SyncHardwareAPI) -> None:
@@ -43,7 +68,7 @@ def print_title(title: str) -> None:
4368
length = len(title)
4469
pounds = PRINT_TITLE_POUNDS + ("#" * length) + PRINT_TITLE_POUNDS
4570
middle = f"#{PRINT_HEADER_SPACES}" f"{title}" f"{PRINT_HEADER_SPACES}#"
46-
print(f"\n{pounds}\n{middle}\n{pounds}\n")
71+
_output(f"\n{pounds}\n{middle}\n{pounds}\n")
4772

4873

4974
def print_header(header: str) -> None:
@@ -56,19 +81,19 @@ def print_header(header: str) -> None:
5681
length = len(header)
5782
dashes = PRINT_HEADER_DASHES + ("-" * length) + PRINT_HEADER_DASHES
5883
middle = f"|{PRINT_HEADER_SPACES}{header}{PRINT_HEADER_SPACES}|"
59-
print(f"\n{dashes}\n{middle}\n{dashes}\n")
84+
_output(f"\n{dashes}\n{middle}\n{dashes}\n")
6085

6186

6287
def print_error(message: str) -> None:
6388
"""Print error."""
64-
print(f"ERROR: {message}")
89+
_output(f"ERROR: {message}")
6590

6691

6792
def print_warning(message: str) -> None:
6893
"""Print warning."""
69-
print(f"WARNING: {message}")
94+
_output(f"WARNING: {message}")
7095

7196

7297
def print_info(message: str) -> None:
7398
"""Print information."""
74-
print(message)
99+
_output(message)

hardware-testing/hardware_testing/gravimetric/protocol_replacement/96ch1000.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tipracks_50ul,D2
1212
tipracks_200ul,,,,,,,,,
1313
tipracks_1000ul,,,,,,,,,
1414
labware_on_scale,nest_1_reservoir_195ml,A1,,,,,,,
15-
slot_scale,B1,,,,,,,,
15+
slot_scale,C1,,,,,,,,
1616
volumes_to_test_20ul,,,,,,,,,
1717
volumes_to_test_50ul,50,,,,,,,,
1818
volumes_to_test_200ul,,,,,,,,,

hardware-testing/hardware_testing/gravimetric/protocol_replacement/96ch200.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tipracks_50ul,D2,D3,C2,C3,B1,B2,B3,A1,A2
1212
tipracks_200ul,,,,,,,,,
1313
tipracks_1000ul,,,,,,,,,
1414
labware_on_scale,nest_1_reservoir_195ml,A1,,,,,,,
15-
slot_scale,B1,,,,,,,,
15+
slot_scale,C1,,,,,,,,
1616
volumes_to_test_20ul,,,,,,,,,
1717
volumes_to_test_50ul,50,,,,,,,,
1818
volumes_to_test_200ul,,,,,,,,,

0 commit comments

Comments
 (0)