-
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(robot-server): add pipette calibration data to instruments endpoint #12498
Conversation
…ndpoint Supply offset, source and last modified date of pipette offset calibration data for flex pipettes from the GET instruments endpoint re RSS-167
ec4ce6c
to
378ab37
Compare
Codecov Report
@@ Coverage Diff @@
## edge #12498 +/- ##
=======================================
Coverage 73.67% 73.67%
=======================================
Files 2252 2252
Lines 61976 61976
Branches 6517 6517
=======================================
Hits 45658 45658
Misses 14757 14757
Partials 1561 1561
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.
Initial thoughts. Mostly looks good! I can update the tests on Monday.
api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py
Outdated
Show resolved
Hide resolved
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 it's the right approach to not include OT2 instruments' calibration data here so thanks for making that change!
After looking into it a bit more, I think it would be best to not change PipetteDict
. The field we are adding is OT3 specific while PipetteDict is used by OT2 as well. If we try to include OT2's pipette offset, then the field ends up accepting different types (even though they are both called PipetteOffsetByPipetteMount
, they are actually two different types). With this, the final thing that makes me reluctant to modifying PipetteDict
is that it's known that there are plans to refactor it and I don't know if adding this field fits with those plans.
So that said, I think most of what this PR is doing in the server can stay the same, except, instead of trying to fetch calibration info from PipetteDict, I would tap into the OT3API and create a getter to fetch pipette calibration data from it. Then use this method in the instruments endpoint router.
@@ -74,6 +75,7 @@ class PipetteDict(InstrumentDict): | |||
model: PipetteModel | |||
back_compat_names: List[PipetteName] | |||
pipette_id: str | |||
pipette_offset: Optional[PipetteOffsetByPipetteMount] |
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 am a bit surprised this isn't making OT2 tests to fail because this type is shared between OT3 and OT2 instruments and we aren't setting this field for OT2 instruments.
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 a doc string change request, but otherwise LGTM
Co-authored-by: Alise Au <[email protected]>
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.
Three people worked on this PR and we all (+ @ahiuchingau) agree this looks good so we're good to merge!
api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py
Outdated
Show resolved
Hide resolved
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.
tested on OT-2 and OT-3. shows only on OT-3 as expected!
Overview
Supply offset, source and last modified date of pipette offset calibration data for flex pipettes
from the GET instruments endpoint
re RSS-167
Test Plan
/instruments
endpoint.Changelog
get_instrument_offset
method to OT3API and PipetteHandlerReview requests
PipetteDict
. We might end up doing that eventually, but that would require updating some code related to OT2 pipettes as well in order to either not provide any calibration data for them or provide the relevant data that's different from OT3 calibration data. After weighing the pros/cons/ unknowns of PipetteDict, we decided to fetch the data in a way that doesn't cause changes to any existing data and types. But let me know if that's not the case.Risk assessment
Low. I've tried to not change any hardware controller components that are in use right now so in the worst case, this affects just the instruments endpoint.