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.
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): simulation allows aspirating and dispensing on a tip rack #7788
fix(api): simulation allows aspirating and dispensing on a tip rack #7788
Changes from 9 commits
766d03b
f6fe164
32f882a
0c67aad
e873a6e
5db7343
2153b77
c5a9e21
5535701
6983b63
dc62508
55a3478
ede0869
09af36a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
(Ignore if you are already working on this) I think we can make a single validation for both aspirate and dispense. In fact, I feel like your
_is_tiprack
function might be just the thing we need.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.
That makes sense, but I guess I was/am thinking two (or three) things:
Please let me know what you think. My mission certainly isn't to unnecessarily change the way you guys do things.
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.
(^might be my uninformed suggestion, so let me know if there's a specific reason for having separate logic for aspirate vs dispense)
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.
At the moment, none. But in a future where we knew what was in them then I can see (provided I am right and aspirate means to suck stuff out of a location) different concerns for the two. Sort of like I was saying in #2 above. For example, what if nothing is in the location from which you are trying to aspirate. Or if a location is beyond capacity once a dispense is performed. And then there is the differences in messaging that we send back in the exception. But here I think you are suggesting that I move the test and exception throwing into instrument_context? There I ran into complexity issues with the linter, but That was a three line conditional vs. a two line conditional.
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.
Was just thinking about dispense and the possibilities if we were smart(er). For example, let's pretend that we know whatever is the pipette when mixed with whatever is in the destination will cause an 💥 . That made me laugh. Don't think we are anywhere close to that. And maybe the user wants to blow themselves up. Who are we to judge!?
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.
Got it! Thanks for that explanation! So now I understand the thought process behind making two separate validations for aspirate & dispense but I still don't get why their logic is different. Can't both take a
types.Location
and just check forif labware.parent and labware.parent.is_tiprack:
?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.
@sanni-t - I changed it as a reaction to this feedback - #7788 (comment). It seems that we always know that the location is a(sorry, didn't fully understand what you were saying). Let me see....Location
and that being the case agreed with @amitlissack in that we don't need to add variability if we don't need it; thinking that it might lead to confusing conclusions (in the brains of other developers).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.
@sanni-t - yes, you are totally right. I think I was too literal about @amitlissack 's suggestion. I see now that they both are constrained to
Location
. Thanks and fixing.