Skip to content

Commit

Permalink
format lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Mar 13, 2024
1 parent 2cc68e7 commit e035a88
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
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
5 changes: 1 addition & 4 deletions hardware-testing/hardware_testing/liquid_sense/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,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 @@ -225,9 +224,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
25 changes: 16 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,34 @@ 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 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

0 comments on commit e035a88

Please sign in to comment.