Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hardware-testing): add full features for volumetric scripts #13492

Merged
merged 65 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
e58e3b0
create a unified gravimetric protocol
ryanthecoder Aug 21, 2023
c52750e
rework tip usage for 96 multitip grav test
ryanthecoder Aug 22, 2023
7ab80d5
add liquid height to the report and add delay's when the door is closed
ryanthecoder Aug 23, 2023
a9e34a4
fixups
ryanthecoder Aug 29, 2023
e0dd48d
correct volume for increment max using 200uL and 1000uL tips
andySigler Aug 29, 2023
2988fa4
call prep for aspirate before aspirating, fixes 96 low volumes
ryanthecoder Aug 29, 2023
d1c6269
pull stuff over from the orphaned tags
ryanthecoder Aug 30, 2023
014b9ec
fixup some of the workarounds
ryanthecoder Aug 31, 2023
ecd752b
fixup merge issue adding redundant tip replacement prompts
ryanthecoder Aug 31, 2023
9a5437d
add LPC protocol
ryanthecoder Sep 1, 2023
d82948c
fixup format and tests
ryanthecoder Sep 1, 2023
aa1419e
p50single passes sim
ryanthecoder Sep 1, 2023
9d1c78b
min-vol in 12-row is 3mL
andySigler Sep 1, 2023
f7bded3
some improvements to the way pipette preps for the test
ryanthecoder Sep 4, 2023
34f114e
fix bugs i found when running physically
ryanthecoder Sep 4, 2023
789ee70
format
ryanthecoder Sep 4, 2023
5c7dd50
add a raw-log for the scale
ryanthecoder Sep 4, 2023
36aa4f8
adds photometri p50 protocol for LPC
andySigler Sep 5, 2023
6673835
switch to nest 96 deepwell for 1ul photometric
ryanthecoder Sep 5, 2023
2b957c0
DONT MERGE TO EDGE: use the low volume settings as the default
ryanthecoder Sep 5, 2023
346c7a5
log scale comms
ryanthecoder Sep 6, 2023
5de7337
control the bottom plunger positions
ryanthecoder Sep 6, 2023
2f9364c
chore(hardware-testing): update gravimetric patch files
ryanthecoder Sep 6, 2023
084df88
add an ability to change ambiant settings in radwag
ryanthecoder Sep 6, 2023
de5bed7
take a picture after each aspirate
ryanthecoder Sep 6, 2023
f7a7fa8
Revert "DONT MERGE TO EDGE: use the low volume settings as the default"
ryanthecoder Sep 6, 2023
839687e
keep the blow out submerged changed that got removed in the git revert
ryanthecoder Sep 6, 2023
f539917
fix some issues with saving things for the camera
ryanthecoder Sep 6, 2023
f42f9ac
take higer res photo
ryanthecoder Sep 6, 2023
5bc3fb5
fix the mkdir for none p50 tests
ryanthecoder Sep 7, 2023
2ebd6f8
multichannel only test channel 1 on the extra volumes
ryanthecoder Sep 7, 2023
54188d3
take photos with ALL the cameras
ryanthecoder Sep 7, 2023
da8f2d6
refactor out photo takeing into it's own method and call after aspira…
ryanthecoder Sep 7, 2023
d4dd8b3
format
ryanthecoder Sep 7, 2023
82114d4
fix unit tests
vegano1 Sep 11, 2023
70c94a4
make plunger-pos adjustments automatic
andySigler Sep 12, 2023
10f7139
Update P50S v 3.5 function
adcooll Sep 9, 2023
b6c0b56
Update P50M, P1000S_T1000,P1000S_T50 function
adcooll Sep 9, 2023
566a547
copy default P50 function into low-volume definitions
andySigler Sep 12, 2023
d009079
remove unused import
vegano1 Sep 12, 2023
e28192f
adds increment volumes for low-volume mode
andySigler Sep 12, 2023
1b49b19
new --mode argument for increment tests in low-volume mode
andySigler Sep 12, 2023
01b97e1
make sure increment test uses same bottom plunger position during ent…
andySigler Sep 13, 2023
f54fedc
feat(hardware-testing): Adds hacky low-volume feature; Updates accura…
andySigler Sep 13, 2023
49518b2
add protocols for photometric test
andySigler Sep 13, 2023
532ac40
adds 8ch photometric supports
andySigler Sep 13, 2023
f6223c5
Merge branch 'photometric-p50-single' of https://github.com/Opentrons…
vegano1 Sep 14, 2023
42ca4c5
adds seperate protocol for 96ch 200ul tip tests
andySigler Sep 14, 2023
4de4925
start configs in CSV as strings so we don't lose any data
andySigler Sep 14, 2023
20c42dc
photometric src/dest column args are lists
andySigler Sep 18, 2023
934f13c
Merge branch 'photometric-p50-single-LOW-VOLUME-MODE-ENABLED' into ph…
andySigler Sep 18, 2023
fd1e254
correctly pass mode down to pipetting
andySigler Sep 18, 2023
2fd7308
update p50M low volume default function
adcooll Sep 14, 2023
72a967c
Update P50S low volume default function
adcooll Sep 18, 2023
5366483
encoder decimals increased to 5
andySigler Sep 18, 2023
1b50a8b
merge in edge
andySigler Sep 19, 2023
7c578a5
fix formatting in pipette definition
andySigler Sep 19, 2023
819bacd
only delay if not simulating
andySigler Sep 19, 2023
50a34b2
use liquid-class to control plunger position
andySigler Sep 19, 2023
209663c
store fw-version in CSV
andySigler Sep 19, 2023
20e4c9e
adds isolate-volumes and adds flag to CSV
andySigler Sep 19, 2023
1b1541c
linting
andySigler Sep 19, 2023
82201e0
fix push-ot3-gravimetric
vegano1 Sep 19, 2023
0859d29
add default ssh_key
vegano1 Sep 19, 2023
4e2aba1
merge in edge
andySigler Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions hardware-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ test-cov:
$(pytest) $(tests) $(test_opts) $(cov_opts)
-$(MAKE) remove-patches-gravimetric

.PHONY: test-photometric-single
test-photometric-single:
-$(MAKE) apply-patches-gravimetric
$(python) -m hardware_testing.gravimetric --photometric --simulate --pipette 50 --channels 1 --tip 50
$(python) -m hardware_testing.gravimetric --photometric --simulate --pipette 50 --channels 1 --tip 50 --photoplate-col-offset 3
$(python) -m hardware_testing.gravimetric --photometric --simulate --pipette 50 --channels 1 --tip 50 --dye-well-col-offset 3
-$(MAKE) remove-patches-gravimetric

.PHONY: test-photometric
test-photometric:
-$(MAKE) apply-patches-gravimetric
Expand Down Expand Up @@ -115,7 +123,7 @@ test-gravimetric-multi:

.PHONY: test-gravimetric-96
test-gravimetric-96:
$(python) -m hardware_testing.gravimetric --simulate --pipette 1000 --channels 96 --tip 1000 --trials 1 --no-blank
$(python) -m hardware_testing.gravimetric --simulate --pipette 1000 --channels 96 --trials 2 --no-blank

.PHONY: test-gravimetric
test-gravimetric:
Expand Down Expand Up @@ -281,10 +289,10 @@ push-ot3-gravimetric:
$(MAKE) apply-patches-gravimetric
-$(MAKE) sync-sw-ot3
$(MAKE) remove-patches-gravimetric
scp $(ssh_helper) -r -O hardware_testing/labware/opentrons_flex_96_tiprack_50ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r -O hardware_testing/labware/opentrons_flex_96_tiprack_200ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r -O hardware_testing/labware/opentrons_flex_96_tiprack_1000ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r -O hardware_testing/labware/radwag_pipette_calibration_vial/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r hardware_testing/labware/opentrons_flex_96_tiprack_50ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r hardware_testing/labware/opentrons_flex_96_tiprack_200ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r hardware_testing/labware/opentrons_flex_96_tiprack_1000ul_adp/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/
scp $(ssh_helper) -r hardware_testing/labware/radwag_pipette_calibration_vial/ root@$(host):/data/labware/v2/custom_definitions/custom_beta/

.PHONY: apply-patches-gravimetric
apply-patches-gravimetric:
Expand Down
6 changes: 3 additions & 3 deletions hardware-testing/hardware_testing/data/csv_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def store(self, *data: Any, print_results: bool = True) -> None:
self._elapsed_time = time() - self._start_time
for i, expected_type in enumerate(self._data_types):
if data[i] is None:
self._data[i] = data[i]
self._data[i] = None
else:
try:
self._data[i] = expected_type(data[i])
Expand All @@ -144,8 +144,8 @@ def store(self, *data: Any, print_results: bool = True) -> None:
f"[{self.tag}] unexpected data type {type(data[i])} "
f'with value "{data[i]}" at index {i}'
)
self._stored = True
if print_results and CSVResult in self._data_types:
self._stored = bool(None not in self._data)
if self._stored and print_results and CSVResult in self._data_types:
print_csv_result(self.tag, CSVResult.from_bool(self.result_passed))


Expand Down
8 changes: 7 additions & 1 deletion hardware-testing/hardware_testing/data/ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Production QC User Interface."""
from opentrons.hardware_control import SyncHardwareAPI
from opentrons.hardware_control.types import StatusBarState
from time import sleep

PRINT_HEADER_NUM_SPACES = 4
PRINT_HEADER_DASHES = "-" * PRINT_HEADER_NUM_SPACES
Expand All @@ -26,11 +27,16 @@ def get_user_ready(message: str) -> None:
input(f"WAIT: {message}, press ENTER when ready: ")


def alert_user_ready(message: str, hw: SyncHardwareAPI) -> None:
def alert_user_ready(message: str, hw: SyncHardwareAPI, delay: int = 0) -> None:
"""Flash the ui lights on the ot3 and then use the get_user_ready."""
hw.set_status_bar_state(StatusBarState.PAUSED)
get_user_ready(message)
hw.set_status_bar_state(StatusBarState.CONFIRMATION)
if delay > 0:
print_info(f"Please wait {delay} seconds:")
for sec in range(delay):
print(f" - {sec + 1}/{delay}")
sleep(0 if hw.is_simulator else 1)


def print_title(title: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,10 @@ class RadwagValueRelease(Enum):
fast = 1
fast_reliable = 2
reliable = 3


class RadwagAmbiant(Enum):
"""Radwag ambiant enviornment states."""

unstable = 0
stable = 1
19 changes: 18 additions & 1 deletion hardware-testing/hardware_testing/drivers/radwag/driver.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Radwag Scale Driver."""
from abc import ABC, abstractmethod
from typing import Tuple, Optional

import datetime
from serial import Serial # type: ignore[import]

from .commands import (
RadwagCommand,
RadwagWorkingMode,
RadwagFilter,
RadwagValueRelease,
RadwagAmbiant,
radwag_command_format,
)
from .responses import RadwagResponse, RadwagResponseCodes, radwag_response_parse
Expand Down Expand Up @@ -86,6 +87,7 @@ class RadwagScale(RadwagScaleBase):
def __init__(self, connection: Serial) -> None:
"""Constructor."""
self._connection = connection
self._raw_log = open("/data/testing_data/scale_raw.txt", "w")

@classmethod
def create(
Expand All @@ -102,6 +104,7 @@ def _write_command(self, cmd: str) -> None:
cmd_str = radwag_command_format(cmd)
cmd_bytes = cmd_str.encode("utf-8")
send_len = self._connection.write(cmd_bytes)
self._raw_log.write(f"{datetime.datetime.now()} --> {cmd_bytes!r}\n")
assert send_len == len(cmd_bytes), (
f'Radwag command "{cmd}" ({str(cmd_bytes)} '
f"bytes) only sent {send_len} bytes"
Expand All @@ -117,6 +120,7 @@ def _read_response(
self._connection.timeout = prev_timeout
else:
response = self._connection.readline()
self._raw_log.write(f"{datetime.datetime.now()} <-- {response}\n")
data = radwag_response_parse(response.decode("utf-8"), command)
return data

Expand Down Expand Up @@ -150,6 +154,7 @@ def connect(self) -> None:
def disconnect(self) -> None:
"""Disconnect."""
self._connection.close()
self._raw_log.close()

def read_serial_number(self) -> str:
"""Read serial number."""
Expand Down Expand Up @@ -185,6 +190,14 @@ def value_release(self, val_rel: RadwagValueRelease) -> None:
res.code == RadwagResponseCodes.CARRIED_OUT
), f"Unexpected response code: {res.code}"

def ambiant(self, amb_rel: RadwagAmbiant) -> None:
"""Set the value release type."""
cmd = RadwagCommand.SET_AMBIENT_CONDITIONS_STATE
res = self._write_command_and_read_response(cmd, append=str(amb_rel.value))
assert (
res.code == RadwagResponseCodes.CARRIED_OUT
), f"Unexpected response code: {res.code}"

def continuous_transmission(self, enable: bool) -> None:
"""Enable/disable continuous transmissions."""
if enable:
Expand Down Expand Up @@ -272,6 +285,10 @@ def value_release(self, val_rel: RadwagValueRelease) -> None:
"""Value release."""
return

def ambiant(self, amb_rel: RadwagAmbiant) -> None:
"""Set the value release type."""
return

def continuous_transmission(self, enable: bool) -> None:
"""Continuous transmission."""
return
Expand Down
Loading