-
Notifications
You must be signed in to change notification settings - Fork 179
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: Add script for provisioning Flex pipettes in emulation #12897
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #12897 +/- ##
==========================================
+ Coverage 73.01% 73.02% +0.01%
==========================================
Files 1516 1517 +1
Lines 49686 49727 +41
Branches 3037 3037
==========================================
+ Hits 36277 36315 +38
- Misses 12943 12946 +3
Partials 466 466
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this looks correct to me, couple of comments you can ignore 👍
LEFT_PIPETTE_ENV_VAR_NAME = "LEFT_OT3_PIPETTE_DEFINITION" | ||
RIGHT_PIPETTE_ENV_VAR_NAME = "RIGHT_OT3_PIPETTE_DEFINITION" | ||
|
||
LEFT_PIPETTE_EEPROM_DIR_PATH = "/volumes/left-pipette-eeprom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of me thinks that these should be parameters instead of hard coded, but this is such a specialized script that I don't think it matters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can easily make these part of the parsed environment variable.
Would that suffice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert not os.path.exists(left_eeprom_path) | ||
assert not os.path.exists(right_eeprom_path) | ||
emulation_pipette_provision.main() | ||
assert os.path.exists(left_eeprom_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth it to verify that the contents of these files is correct by calling serial_val_from_parts
and reading the files. Unfortunate that we can't deserialize the encoded serial values though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, I am calling that function under the hood to generate the serial number.
Is it redundant to call the same function to compare that value to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what makes it worth testing is that you want to verify that the script, viewed as a black box, is generating the right contents in the right files. I agree that it isn't the most thorough way to test it, but it at least makes sure you're 1) getting all of the info from the environment variable 2) putting the left/right info in the correct respective files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well good thing you suggested this.
I, being an idiot, was only ever evaluating the left pipette and storing it to both left and right.
Thanks @fsinapi. You saved me from myself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
* feat: Add script for provisioning pipettes in emulation * chore: Change to support full eeprom path being passed * Linting * remove unused constants
Overview
Add script for provisioning Flex pipettes in emulation. This script is run inside the
ot3-firmware-builder
container from opentrons-emulationScript Flow:
LEFT_OT3_PIPETTE_DEFINITION
andRIGHT_OT3_PIPETTE_DEFINITION
OT3PipetteEnvVar
dataclass objectopentrons_hardware.instruments.pipettes.serials.serial_val_from_parts
Note:
It is out of scope for this PR to actually ensure that the pipettes run correctly in emulation. They currently do not, and I cannot figure out why. Going to circle up with the wizards in embedded land to see if they can help me figure it out. A followup PR will address them actually working
Test Plan
Changelog
Review requests
Do you think it is okay to not validate that the content of the eeprom file is correct?
I am not doing this for a few reasons:
Risk assessment
Low