Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed Feb 15, 2024
1 parent a074bd0 commit efb91ec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
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
6 changes: 1 addition & 5 deletions hardware-testing/hardware_testing/gravimetric/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ def run(cfg: config.GravimetricConfig, resources: TestResources) -> None: # noq
resources.pipette,
return_tip=False,
minimum_z_height=_minimum_z_height(cfg),
offset=_get_channel_offset(cfg, 0),
) # always trash calibration tips
calibration_tip_in_use = False
trial_count = 0
Expand Down Expand Up @@ -739,10 +738,7 @@ def run(cfg: config.GravimetricConfig, resources: TestResources) -> None: # noq
if not cfg.same_tip:
resources.pipette._retract() # retract to top of gantry
_drop_tip(
resources.pipette,
cfg.return_tip,
_minimum_z_height(cfg),
_get_channel_offset(cfg, run_trial.channel),
resources.pipette, cfg.return_tip, _minimum_z_height(cfg)
)

ui.print_header(f"{volume} uL channel {channel + 1} CALCULATIONS")
Expand Down
35 changes: 17 additions & 18 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,11 +235,14 @@ 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_aspirate_volume(
state_view: StateView, pipette_id: str, aspirate_volume: float
) -> float:
return aspirate_volume

def _override_check_deck_conflict_for_8_channel(

def _check_safe_for_pipette_movement(
engine_state: StateView,
pipette_id: str,
labware_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,13 @@ 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_aspirate_volume
) # type: ignore[assignment]
PE_deck_conflict.check_safe_for_pipette_movement = (
_check_safe_for_pipette_movement
) # type: ignore[assignment]


def _get_channel_offset(cfg: config.VolumetricConfig, channel: int) -> Point:
assert (
Expand Down Expand Up @@ -328,24 +339,12 @@ def _pick_up_tip(


def _drop_tip(
pipette: InstrumentContext,
return_tip: bool,
minimum_z_height: int = 0,
offset: Optional[Point] = None,
pipette: InstrumentContext, return_tip: bool, minimum_z_height: int = 0
) -> None:
if return_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))
pipette.drop_tip(
trash_container,
home_after=False,
)
else:
pipette.drop_tip(home_after=False)
pipette.drop_tip(home_after=False)
if minimum_z_height > 0:
cur_location = pipette._get_last_location_by_api_version()
if cur_location is not None:
Expand Down

0 comments on commit efb91ec

Please sign in to comment.