-
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(api): Validate plate reader status using live data hookups for engine and introduce lid status to the PAPI #15872
Conversation
…ds and bump required version to 2.21
… ensure addressable areas used exclusively
this was set to 2 21 for testing but should remain at 2 20
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 makes sense 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.
Suggestions for some potentially user-facing copy.
self._core.open_lid() | ||
|
||
@requires_version(2, 21) | ||
def is_lid_on(self) -> bool: | ||
"""Return True if the Absorbance Reader's lid is currently closed.""" |
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.
Let's Sphinx it up
"""Return True if the Absorbance Reader's lid is currently closed.""" | |
"""Return ``True`` if the Absorbance Reader's lid is currently closed.""" |
I'm OK with leaving the implication that False
means it's open, but if false means open or unknown, we should state that.
if isinstance(new_location, AbsorbanceReaderContext): | ||
if new_location.is_lid_on(): | ||
raise CommandPreconditionViolated( | ||
f"Cannot move {labware.name} onto the Absorbance Reader Module when Lid is Closed." |
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.
f"Cannot move {labware.name} onto the Absorbance Reader Module when Lid is Closed." | |
f"Cannot move {labware.name} onto the Absorbance Reader Module when its lid is closed." |
nit
result = await abs_reader.get_current_lid_status() | ||
if result is not AbsorbanceReaderLidStatus.ON: | ||
raise CannotPerformModuleAction( | ||
"The Opentrons Plate Reader lid mechanicaly position did not match expected Closed state." |
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.
can this error ever bubble up to be shown to users? if so, needs an edit.
"The Opentrons Plate Reader lid mechanicaly position did not match expected Closed state." | |
"The mechanical position of the Absorbance Plate Reader's lid did not match the expected 'closed' state." |
Looking good to me, i tested this on a PlatypusExpansion robot |
Overview
Ensure that the lid position is automatically updated in live runs, and that the live data is used to validate position on load, open and close. Validate that labware cannot be moved to the plate reader unless the plate reader is open. Add
is_lid_on()
PAPI exposure for use in python protocols.Closes: PLAT-208 PLAT-386
Test Plan and Hands on Testing
Run the following protocol and ensure the expected results below occur (NOTE: Must set Max API version to 2.21):
Tests:
Changelog
move_labware(...)
function to contain special case validation for moving to a plate reader module when it's lid status is closed (expect error to raise).is_lid_on()
methodReview requests
Take a look at the validation workaround that had to be put into
move_labware(...)
. It's a special casing due to the way that plate reader lid labware is being injected into the engine labware store via the deck configuration. Previously, if the lid was closed and an attempt was made to move labware onto the plate reader, we would get a random key error with the unique labware ID of the lid returned. This addition returns a much nicer error, but I'm not entirely sure if special casing is the best approach here, let me know any thoughts on this.Risk assessment
Low risk - only effects plate reader module data and validations.