Skip to content
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): Allow recovering from errors that happen during the preparation part of an aspirate command #16896

Draft
wants to merge 3 commits into
base: edge
Choose a base branch
from

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Nov 19, 2024

Overview

Closes RQA-3567.

Test Plan and Hands on Testing

  • While the pipette is doing a plunger motion as part of preparation to aspirate, above the well, try inducing an overpressure error and recovering from it using the existing frontend.
    • I have not had any luck inducing an overpressure error here. It seems like the volume moved is too small.
  • Try inducing a stall error during the prepare-to-aspirate step, and recover from it by manually issuing a commandType: "home" intent: "fixit" command.

Changelog

There are 4 substeps in an aspirate command:

  1. Maybe, move above the well.
  2. Maybe, move the plunger to recover from a prior blowOut and prepare for the aspirate.
  3. Move to the target location (normally, into the liquid).
  4. Move the plunger to aspirate the requested volume.

Prior work already lets us recover from overpressure and stall errors in steps 3 and 4. This does the same for steps 1 and 2.

Review requests

Risk assessment

if isinstance(move_result, DefinedErrorData):
return DefinedErrorData(move_result.public, state_update=state_update)

# TODO: Figure out what to do for state_update_if_false_positive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo passthrough and union with previous successes

@SyntaxColoring SyntaxColoring changed the title Recoverable prepare to aspirate feat(api): Allow recovering from errors that happen during the preparation part of an aspirate command Nov 20, 2024
Comment on lines +302 to +314
def append(self, other: Self) -> Self:
"""Apply another `StateUpdate` "on top of" this one.

This object is mutated in-place, taking values from `other`.
If an attribute in `other` is `NO_CHANGE`, the value in this object is kept.
"""
fields = dataclasses.fields(other)
for field in fields:
other_value = other.__dict__[field.name]
if other_value != NO_CHANGE:
self.__dict__[field.name] = other_value
return self

Copy link
Contributor Author

@SyntaxColoring SyntaxColoring Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is append() a good name for this? Is there a naming scheme that harmonizes better with reduce()?

Comment on lines 315 to 317
@classmethod
def reduce(cls: typing.Type[Self], *args: Self) -> Self:
"""Fuse multiple state updates into a single one.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Can probably implement reduce() in terms of append().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants