Skip to content

Commit

Permalink
feat(hardware-testing): liquid sense testing script (#14807)
Browse files Browse the repository at this point in the history
<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview

This PR adds a new testing script that allows us to test all kinds of
variations of the liquid-sense routine
it adds some additional features in the hardware control layer to change
up output options to during the probe so we can gate using the
buffer-on-pipette feature to a firmware version flag, since that feature
has to be compiled in separately

<!--
Use this section to describe your pull-request at a high level. If the
PR addresses any open issues, please tag the issues here.
-->

# Test Plan

<!--
Use this section to describe the steps that you took to test your Pull
Request.
If you did not perform any testing provide justification why.

OT-3 Developers: You should default to testing on actual physical
hardware.
Once again, if you did not perform testing against hardware, justify
why.

Note: It can be helpful to write a test plan before doing development

Example Test Plan (HTTP API Change)

- Verified that new optional argument `dance-party` causes the robot to
flash its lights, move the pipettes,
then home.
- Verified that when you omit the `dance-party` option the robot homes
normally
- Added protocol that uses `dance-party` argument to G-Code Testing
Suite
- Ran protocol that did not use `dance-party` argument and everything
was successful
- Added unit tests to validate that changes to pydantic model are
correct

-->

# Changelog

<!--
List out the changes to the code in this PR. Please try your best to
categorize your changes and describe what has changed and why.

Example changelog:
- Fixed app crash when trying to calibrate an illegal pipette
- Added state to API to track pipette usage
- Updated API docs to mention only two pipettes are supported

IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
-->

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->

---------

Co-authored-by: caila-marashaj <[email protected]>
  • Loading branch information
ryanthecoder and caila-marashaj authored Apr 9, 2024
1 parent 1819b8c commit 2cff9d2
Show file tree
Hide file tree
Showing 17 changed files with 1,287 additions and 9 deletions.
8 changes: 8 additions & 0 deletions hardware-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ test-examples:
test-scripts:
$(python) -m hardware_testing.scripts.bowtie_ot3 --simulate

.PHONY: test-liquid-sense
test-liquid-sense:
$(python) -m hardware_testing.liquid_sense --simulate --pipette 1000 --channels 1
$(python) -m hardware_testing.liquid_sense --simulate --pipette 50 --channels 1
$(python) -m hardware_testing.liquid_sense --simulate --pipette 1000 --channels 8
$(python) -m hardware_testing.liquid_sense --simulate --pipette 50 --channels 8
$(python) -m hardware_testing.liquid_sense --simulate --pipette 1000 --channels 96

.PHONY: test-integration
test-integration: test-production-qc test-examples test-scripts test-gravimetric

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ class GravimetricRecorder:
"""Gravimetric Recorder."""

def __init__(
self, cfg: GravimetricRecorderConfig, scale: Scale, simulate: bool = False
self,
cfg: GravimetricRecorderConfig,
scale: Scale,
simulate: bool = False,
start_graph: bool = True,
) -> None:
"""Gravimetric Recorder."""
self._cfg = cfg
Expand All @@ -294,7 +298,7 @@ def __init__(
self._scale_serial: str = ""
self._scale_max_capacity: float = 0.0
super().__init__()
self.activate()
self.activate(start_graph)

def _start_graph_server_process(self) -> None:
if self.is_simulator:
Expand Down Expand Up @@ -350,9 +354,10 @@ def add_simulation_mass(self, mass: float) -> None:
"""Add simulation mass."""
self._scale.add_simulation_mass(mass)

def activate(self) -> None:
def activate(self, graph: bool = True) -> None:
"""Activate."""
self._start_graph_server_process()
if graph:
self._start_graph_server_process()
# Some Radwag settings cannot be controlled remotely.
# Listed below are the things the must be done using the touchscreen:
# 1) Set profile to USER
Expand Down
57 changes: 57 additions & 0 deletions hardware-testing/hardware_testing/labware/dial_indicator/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"schemaVersion": 2,
"version": 1,
"namespace": "custom_beta",
"ordering": [["A1"]],
"metadata": {
"displayName": "Mitutoyo Digimatic Indicator",
"displayCategory": "tubeRack",
"displayVolumeUnits": "µL",
"tags": []
},
"dimensions": {
"xDimension": 128,
"yDimension": 86,
"zDimension": 136
},
"parameters": {
"format": "irregular",
"quirks": [],
"isTiprack": false,
"isMagneticModuleCompatible": false,
"loadName": "dial_indicator"
},
"wells": {
"A1": {
"depth": 14,
"totalLiquidVolume": 10,
"shape": "circular",
"diameter": 4,
"x": 60.8,
"y": 41.5,
"z": 135
}
},
"brand": {
"brand": "Mitutoyo",
"brandId": ["ID-S"]
},
"groups": [
{
"brand": {
"brand": "Mitutoyo",
"brandId": ["ID-S"]
},
"metadata": {
"wellBottomShape": "flat",
"displayCategory": "tubeRack"
},
"wells": ["A1"]
}
],
"cornerOffsetFromSlot": {
"x": 0,
"y": 0,
"z": 0
}
}
1 change: 1 addition & 0 deletions hardware-testing/hardware_testing/liquid_sense/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Liquid Sense."""
Loading

0 comments on commit 2cff9d2

Please sign in to comment.