-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix(api): add supported wavelengths to runtime error when initializing the plate reader. #16797
fix(api): add supported wavelengths to runtime error when initializing the plate reader. #16797
Conversation
…g the plate reader.
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.
Nice, so simple! Would love to be able to surface this in analysis, but that's for another day…
api/src/opentrons/protocol_engine/commands/absorbance_reader/initialize.py
Outdated
Show resolved
Hide resolved
…nitialize.py Co-authored-by: Ed Cormany <edward.cormany@opentrons.com>
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.
All my homies love actionability.
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.
Comments inline, but should use a protocol engine error and maybe massage the formatting of the wavelengths.
@@ -70,7 +70,10 @@ async def execute(self, params: InitializeParams) -> SuccessData[InitializeResul | |||
supported_wavelengths | |||
) | |||
if unsupported_wavelengths: | |||
raise ValueError(f"Unsupported wavelengths: {unsupported_wavelengths}") | |||
raise ValueError( |
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 should be an error from protocol_engine.errors
that gets associated with an error code - maybe invalid protocol data, but ok to fall back to 4000 general error instead. If it's just a raw exception it will get a scarier UI.
Also this seems like it's just dumping a set to string which will look like this: "Unsupported wavelengths: {1000, 1400, 1200}. Use one of {500, 800, 1000} instead." Feels a little terse, maybe make it {', '.join([str(wavelength) + 'nm' for wavelength in unsupported_wavelengths])
instead?
…github.com/Opentrons/opentrons into add-supported-wavelengths-to-runtime-error
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.
Excellent, thank you!
Overview
Add the supported wavelengths to the runtime error raised when an invalid wavelength is provided.
Closes: RQA-3568
Test Plan and Hands on Testing
Changelog
InvalidWavelengthError
to denote incompatible wavelengths with the current plate reader.InvalidWavelengthError
and format a message to clarify what wavelengths can be used.Review requests
Risk assessment
low, log only change