-
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): Error handling for unsupported pipette configuration behavior with partial column and row #15961
Merged
CaseyBatten
merged 10 commits into
chore_release-8.0.0
from
partial_column_and_row_bug_fixes
Aug 14, 2024
Merged
fix(api): Error handling for unsupported pipette configuration behavior with partial column and row #15961
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
14ef884
error casing and tests for unsupported pipette configuration behavior
CaseyBatten ed45146
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten 0302aa7
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten 900b9a6
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten 5b6b6e7
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten 95fb706
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten a1952c2
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten 165a8c6
Update api/src/opentrons/protocol_api/instrument_context.py
CaseyBatten e92429d
account for COLUMN configuration on 8ch
CaseyBatten d197057
test corrections
CaseyBatten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2077,6 +2077,8 @@ def configure_nozzle_layout( # noqa: C901 | |
f"Nozzle layout configuration of style {style.value} is unsupported in API Versions lower than {_PARTIAL_NOZZLE_CONFIGURATION_SINGLE_ROW_PARTIAL_COLUMN_ADDED_IN}." | ||
) | ||
|
||
front_right_resolved = front_right | ||
back_left_resolved = back_left | ||
if style != NozzleLayout.ALL: | ||
if start is None: | ||
raise ValueError( | ||
|
@@ -2086,30 +2088,49 @@ def configure_nozzle_layout( # noqa: C901 | |
raise ValueError( | ||
f"Starting nozzle specified is not one of {types.ALLOWED_PRIMARY_NOZZLES}" | ||
) | ||
if style == NozzleLayout.QUADRANT: | ||
if front_right is None and back_left is None: | ||
raise ValueError( | ||
"Cannot configure a QUADRANT layout without a front right or back left nozzle." | ||
) | ||
elif not (front_right is None and back_left is None): | ||
raise ValueError( | ||
f"Parameters 'front_right' and 'back_left' cannot be used with {style.value} Nozzle Configuration Layout." | ||
) | ||
if style == NozzleLayout.ROW: | ||
if self.channels != 96: | ||
raise ValueError( | ||
"Row configuration is only supported on 96-Channel pipettes." | ||
) | ||
if style == NozzleLayout.PARTIAL_COLUMN: | ||
if self.channels == 1 or self.channels == 96: | ||
raise ValueError( | ||
"Partial column configuration is only supported on 8-Channel pipettes." | ||
) | ||
|
||
front_right_resolved = front_right | ||
back_left_resolved = back_left | ||
if style == NozzleLayout.PARTIAL_COLUMN: | ||
if end is None: | ||
if end is None: | ||
raise ValueError( | ||
"Partial column configurations require the 'end' parameter." | ||
) | ||
if start[0] in end: | ||
raise ValueError( | ||
"The 'start' and 'end' parameters of a partial column configuration cannot be in the same row." | ||
) | ||
# Determine if 'end' will be configured as front_right or back_left | ||
if start == "H1" or start == "H12": | ||
if "A" in end: | ||
raise ValueError( | ||
f"A partial column configuration with 'start'={start} cannot have its 'end' parameter be in row A." | ||
) | ||
back_left_resolved = end | ||
elif start == "A1" or start == "A12": | ||
if "H" in end: | ||
raise ValueError( | ||
f"A partial column configuration with 'start'={start} cannot have its 'end' parameter be in row H." | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this should explain that a column configured to use nozzles A through H does not constitute a 'partial' column and that the user should use an |
||
front_right_resolved = end | ||
|
||
if style == NozzleLayout.QUADRANT: | ||
if front_right is None and back_left is None: | ||
raise ValueError( | ||
"Cannot configure a QUADRANT layout without a front right or back left nozzle." | ||
) | ||
elif not (front_right is None and back_left is None): | ||
raise ValueError( | ||
"Parameter 'end' is required for Partial Column Nozzle Configuration Layout." | ||
f"Parameters 'front_right' and 'back_left' cannot be used with a {style.value} nozzle configuration." | ||
) | ||
|
||
# Determine if 'end' will be configured as front_right or back_left | ||
if start == "H1" or start == "H12": | ||
back_left_resolved = end | ||
elif start == "A1" or start == "A12": | ||
front_right_resolved = end | ||
|
||
self._core.configure_nozzle_layout( | ||
style, | ||
primary_nozzle=start, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we repeat the same check for
COLUMN
style too?