Skip to content

Commit

Permalink
fix lint errors after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj authored and ryanthecoder committed Apr 3, 2024
1 parent 731df84 commit f177ceb
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
1 change: 0 additions & 1 deletion api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,6 @@ async def liquid_probe(
probe=probe if probe else InstrumentProbeType.PRIMARY,
)
end_pos = await self.gantry_position(mount, refresh=True)
#await self.move_to(mount, probe_start_pos)
return end_pos.z

async def capacitive_probe(
Expand Down
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 @@ -1536,7 +1536,7 @@ def move_to(
def _retract(
self,
) -> None:
self._core.retract()
self._core._retract()

@property
@requires_version(2, 0)
Expand Down
19 changes: 13 additions & 6 deletions hardware-testing/hardware_testing/gravimetric/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from hardware_testing.opentrons_api.helpers_ot3 import clear_pipette_ul_per_mm

import opentrons.protocol_engine.execution.pipetting as PE_pipetting
from opentrons.protocol_engine.notes import CommandNoteAdder

from opentrons.protocol_engine import (
StateView,
Expand Down Expand Up @@ -238,12 +237,23 @@ 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
) -> float:
return aspirate_volume


def _override_check_safe_for_pipette_movement(
engine_state: StateView,
pipette_id: str,
labware_id: str,
well_name: str,
well_location: Union[WellLocation, DropTipWellLocation],
) -> None:
pass


def _override_check_deck_conflict_for_8_channel(
engine_state: StateView,
pipette_id: str,
Expand All @@ -263,11 +273,8 @@ def _override_software_supports_high_volumes() -> None:
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]
_override_validate_aspirate_volume # type: ignore[assignment]
)


def _get_channel_offset(cfg: config.VolumetricConfig, channel: int) -> Point:
Expand Down
2 changes: 1 addition & 1 deletion hardware-testing/hardware_testing/liquid_sense/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def build_run_args(cls, args: argparse.Namespace) -> "RunArgs":
aspirate=args.plunger_direction == "aspirate",
dial_indicator=dial,
plunger_speed=args.plunger_speed,
trials_before_jog=args.trials_before_jog
trials_before_jog=args.trials_before_jog,
)


Expand Down
16 changes: 8 additions & 8 deletions hardware-testing/hardware_testing/liquid_sense/execute.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Logic for running a single liquid probe test."""
from typing import Dict, Any, List, Tuple, Optional
from .report import store_tip_results, store_trial, store_baseline_trial
from opentrons.config.types import LiquidProbeSettings
from opentrons.config.types import LiquidProbeSettings, OutputOptions
from .__main__ import RunArgs
from hardware_testing.gravimetric.workarounds import get_sync_hw_api
from hardware_testing.gravimetric.helpers import (
Expand Down Expand Up @@ -164,7 +164,9 @@ def run(tip: int, run_args: RunArgs) -> None:
hw_api = get_sync_hw_api(run_args.ctx)
test_well: Well = test_labware["A1"]
_load_tipracks(run_args.ctx, run_args.pipette_channels, run_args.protocol_cfg, tip)
tips: List[Well] = get_unused_tips(run_args.ctx, tip)
tips: List[Well] = get_unused_tips(
ctx=run_args.ctx, tip_volume=tip, pipette_mount=""
)
assert len(tips) >= run_args.trials
results: List[float] = []
adjusted_results: List[float] = []
Expand All @@ -182,7 +184,7 @@ def _get_baseline() -> float:
target_height = test_well.bottom(liquid_height).point.z

run_args.pipette._retract()
tip_offset = 0.0
# tip_offset = 0.0
if run_args.dial_indicator is not None:
run_args.pipette.move_to(dial_well.top())
tip_offset = run_args.dial_indicator.read_stable()
Expand All @@ -191,6 +193,7 @@ def _get_baseline() -> float:
run_args.pipette.return_tip()
else:
run_args.pipette.drop_tip()
return target_height

env_data = run_args.environment_sensor.get_reading()

Expand All @@ -210,7 +213,6 @@ def _get_baseline() -> float:
if (trials_before_jog > 0) and (trial % trials_before_jog == 0):
tip_offset = _get_baseline()


print(f"Picking up {tip}ul tip")
run_args.pipette.pick_up_tip(tips.pop(0))
run_args.pipette.move_to(test_well.top())
Expand All @@ -224,9 +226,7 @@ def _get_baseline() -> float:

run_args.pipette._retract()
run_args.pipette.move_to(dial_well.top())
tip_length_offset = (
tip_offset - run_args.dial_indicator.read_stable()
)
tip_length_offset = tip_offset - run_args.dial_indicator.read_stable()
run_args.pipette._retract()
print(f"Tip Offset {tip_length_offset}")

Expand Down Expand Up @@ -291,7 +291,7 @@ def _run_trial(run_args: RunArgs, tip: int, well: Well, trial: int) -> float:
plunger_speed=plunger_speed,
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
expected_liquid_height=110,
log_pressure=True,
output_option=OutputOptions.sync_buffer_to_csv,
aspirate_while_sensing=run_args.aspirate,
auto_zero_sensor=True,
num_baseline_reads=10,
Expand Down
26 changes: 17 additions & 9 deletions hardware-testing/hardware_testing/liquid_sense/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def process_csv_directory( # noqa: C901
pressure_results[tip] = {}
results_settings[tip] = {}
tip_offsets[tip] = []
p_offsets[tip] = [i*0 for i in range(trials)]
p_offsets[tip] = [i * 0 for i in range(trials)]
for trial in range(trials):
pressure_results[tip][trial] = []
results_settings[tip][trial] = (0.0, 0.0, 0.0)
Expand Down Expand Up @@ -108,7 +108,7 @@ def process_csv_directory( # noqa: C901
# we want to line up the z height's of each trial at time==0
# to do this we drop the results at the beginning of each of the trials
# except for one with the longest tip (lower tip offset are longer tips)
min_tip_offset = 0
min_tip_offset = 0.0
if make_graph:
for tip in tips:
min_tip_offset = min(tip_offsets[tip])
Expand All @@ -117,27 +117,35 @@ def process_csv_directory( # noqa: C901
if tip_offsets[tip][trial] > min_tip_offset:
# drop this pressure result
pressure_results[tip][trial].pop(0)
# we don't want to change the length of this array so just stretch out
# the last value
# we don't want to change the length of this array so just
# stretch out the last value
pressure_results[tip][trial].append(
pressure_results[tip][trial][-1]
)
# decrement the offset while this is true so we can account for it later
tip_offsets[tip][trial] -= 0.001 * results_settings[tip][0][0]
# decrement the offset while this is true
# so we can account for it later
tip_offsets[tip][trial] -= (
0.001 * results_settings[tip][0][0]
)
# keep track of how this effects the plunger start position
p_offsets[tip][trial] = (i+1) * 0.001 * results_settings[tip][0][1] * -1
p_offsets[tip][trial] = (
(i + 1) * 0.001 * results_settings[tip][0][1] * -1
)
else:
# we've lined up this trial so move to the next
break
# write the processed test data
for tip in tips:
time = 0.0
final_report_writer.writerow(pressure_header_row)
meniscus_time = (meniscus_travel + min_tip_offset) / results_settings[tip][0][0]
meniscus_time = (meniscus_travel + min_tip_offset) / results_settings[
tip
][0][0]
for i in range(max_results_len):
pressure_row: List[str] = [f"{time}"]
if isclose(
time, meniscus_time,
time,
meniscus_time,
rel_tol=0.001,
):
pressure_row.append("Meniscus")
Expand Down
14 changes: 0 additions & 14 deletions hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,6 @@
SensorOutputBinding,
ErrorCode,
)
from opentrons_hardware.firmware_bindings.messages.payloads import (
SendAccumulatedPressureDataPayload,
BindSensorOutputRequestPayload,
)
from opentrons_hardware.firmware_bindings.messages.fields import (
SensorIdField,
SensorOutputBindingField,
SensorTypeField,
)
from opentrons_hardware.firmware_bindings.messages.message_definitions import (
BindSensorOutputRequest,
SendAccumulatedPressureDataRequest,
)
from opentrons_hardware.sensors.sensor_driver import SensorDriver, LogListener
from opentrons_hardware.sensors.types import (
SensorDataType,
Expand Down Expand Up @@ -247,7 +234,6 @@ async def liquid_probe(
)

sensor_runner = MoveGroupRunner(move_groups=[[sensor_group]])
log_file: str = "/var/pressure_sensor_data.csv" if not data_file else data_file
if csv_output:
return await run_stream_output_to_csv(
messenger,
Expand Down

0 comments on commit f177ceb

Please sign in to comment.