-
Notifications
You must be signed in to change notification settings - Fork 180
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
refactor(api): Port tip consumption to StateUpdate #16469
Conversation
This was left over from an earlier refactor.
This makes it harder to forget to update one of them.
`nozzle_map` cannot be `None` since #14529.
To disambiguate with tip rack tip state.
# todo(mm, 2024-10-10): This info is duplicated between here and PipetteState because | ||
# TipStore is using it to compute which tips a PickUpTip removes from the tip rack, | ||
# given the pipette's current nozzle map. We could avoid this duplication by moving the | ||
# computation to TipView, calling it from PickUpTipImplementation, and passing the | ||
# precomputed list of wells to TipStore. | ||
@dataclass | ||
class _PipetteInfo: | ||
channels: int | ||
active_channels: int | ||
nozzle_map: NozzleMap |
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.
Does this seem like a reasonable plan?
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.
yes, definitely
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.
Looks good, and agree with the path forward
# todo(mm, 2024-10-10): This info is duplicated between here and PipetteState because | ||
# TipStore is using it to compute which tips a PickUpTip removes from the tip rack, | ||
# given the pipette's current nozzle map. We could avoid this duplication by moving the | ||
# computation to TipView, calling it from PickUpTipImplementation, and passing the | ||
# precomputed list of wells to TipStore. | ||
@dataclass | ||
class _PipetteInfo: | ||
channels: int | ||
active_channels: int | ||
nozzle_map: NozzleMap |
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.
yes, definitely
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.
Makes sense to me
if nozzle_map: | ||
self._state.active_channels_by_pipette_id[ | ||
pipette_id | ||
] = nozzle_map.tip_count | ||
self._state.nozzle_map_by_pipette_id[pipette_id] = nozzle_map | ||
else: | ||
self._state.active_channels_by_pipette_id[ | ||
pipette_id | ||
] = self._state.channels_by_pipette_id[pipette_id] | ||
|
||
elif isinstance(action, FailCommandAction): | ||
self._handle_failed_command(action) |
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.
Oh nice! Is NozzleMap
always available now? I think there was some state that had nozzle map optional even though I think the map was indeed available.
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.
Oh nice! Is
NozzleMap
always available now?
Yep, for the purposes of TipStore
, at least.
I think there was some state that had nozzle map optional even though I think the map was indeed available.
Good memory. I think that's this, over in PipetteStore
. I'll play around with that and see if we can simplify it now. #14529 (comment)
Overview
A refactor towards EXEC-758 and EXEC-764.
Test Plan and Hands on Testing
Changelog
TipStore
was looking forPickUpTipResult
s to track tips being consumed from tip racks. Convert this to use the newerStateUpdate
mechanism.Review requests
None in particular.
Risk assessment
Low if tests pass.