Skip to content

Commit

Permalink
format/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Mar 4, 2024
1 parent 1ff03fa commit 397c8f5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions api/src/opentrons/hardware_control/backends/flex_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,6 @@ def get_estop_state(self) -> EstopState:

def add_estop_callback(self, cb: HardwareEventHandler) -> HardwareEventUnsubscriber:
...

def _update_tip_state(self, mount: OT3Mount, status: bool) -> None:
...
2 changes: 1 addition & 1 deletion api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def _retract(
) -> None:
self._core.retract()

@property # type: ignore
@property
@requires_version(2, 0)
def mount(self) -> str:
"""
Expand Down
4 changes: 2 additions & 2 deletions hardware-testing/hardware_testing/gravimetric/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def _get_protocol_context(cls, args: argparse.Namespace) -> ProtocolContext:
engine.state_view._labware_store._add_labware_offset(offset)
return _ctx

@classmethod # noqa: C901
def build_run_args(cls, args: argparse.Namespace) -> "RunArgs":
@classmethod
def build_run_args(cls, args: argparse.Namespace) -> "RunArgs": # noqa: C901
"""Build."""
_ctx = RunArgs._get_protocol_context(args)
operator_name = helpers._get_operator_name(_ctx.is_simulating())
Expand Down
24 changes: 18 additions & 6 deletions hardware-testing/hardware_testing/gravimetric/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
WellLocation,
DropTipWellLocation,
)


def _add_fake_simulate(
ctx: protocol_api.ProtocolContext, is_simulating: bool
) -> protocol_api.ProtocolContext:
Expand Down Expand Up @@ -233,10 +235,13 @@ def _override_add_current_volume(self, volume_incr: float) -> None: # noqa: ANN
def _override_ok_to_add_volume(self, volume_incr: float) -> bool: # noqa: ANN001
return True

def _override_validate_aspirate_volume(state_view: StateView, pipette_id: str, aspirate_volume: float

def _override_validate_asp_vol(
state_view: StateView, pipette_id: str, aspirate_volume: float
) -> float:
return aspirate_volume


def _override_check_deck_conflict_for_8_channel(
engine_state: StateView,
pipette_id: str,
Expand All @@ -246,6 +251,7 @@ def _override_check_deck_conflict_for_8_channel(
) -> None:
return None


def _override_software_supports_high_volumes() -> None:
# yea so ok this is pretty ugly but this is super helpful for us
# with this we don't need to apply patches, and can run the testing scripts
Expand All @@ -254,8 +260,11 @@ def _override_software_supports_high_volumes() -> None:
Pipette.set_current_volume = _override_set_current_volume # type: ignore[assignment]
Pipette.ok_to_add_volume = _override_ok_to_add_volume # type: ignore[assignment]
Pipette.add_current_volume = _override_add_current_volume # type: ignore[assignment]
PE_pipetting._validate_aspirate_volume = _override_validate_aspirate_volume # type: ignore[assignment]
PE_deck_conflict._check_deck_conflict_for_8_channel = _override_check_deck_conflict_for_8_channel # type: ignore[assignment]
PE_pipetting._validate_aspirate_volume = _override_validate_asp_vol # type: ignore[assignment]
PE_deck_conflict._check_deck_conflict_for_8_channel = (
_override_check_deck_conflict_for_8_channel
) # type: ignore[assignment]


def _get_channel_offset(cfg: config.VolumetricConfig, channel: int) -> Point:
assert (
Expand Down Expand Up @@ -337,9 +346,12 @@ def _drop_tip(
pipette.return_tip(home_after=False)
else:
if offset is not None:
#we don't actually need the offset, if this is an 8 channel we always center channel a1 over the back of the trash
trash_well = pipette.trash_container.well(0)
trash_container = trash_well.center().move(Point(0,trash_well.width/2,0))
# we don't actually need the offset, if this is an 8 channel we always center channel
# a1 over the back of the trash
trash_well = pipette.trash_container.well(0) # type: ignore[union-attr]
trash_container = trash_well.center().move(
Point(0, trash_well.width / 2, 0) # type: ignore[union-attr, operator]
)
pipette.drop_tip(
trash_container,
home_after=False,
Expand Down

0 comments on commit 397c8f5

Please sign in to comment.