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(abr-testing): longer protocols with liquid waste probing #16994

Open
wants to merge 26 commits into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6995f87
disposable-lid-disposal-parameter
rclarke0 Nov 15, 2024
dddec3c
feat(abr-testing): put lid in trash dvt4 protocol
rclarke0 Nov 15, 2024
0d1e72c
added adapter to temperature module
rclarke0 Nov 18, 2024
4f9ae2d
loaded liquids in abr4 and abr8 protocols
rclarke0 Nov 18, 2024
c34bd75
error handling for unavailable robots
rclarke0 Nov 14, 2024
24d8326
changes to liquid probe data storage
rclarke0 Nov 18, 2024
1342e1a
remove print statement
rclarke0 Nov 19, 2024
434639a
add liquid waste height as seperate column
rclarke0 Nov 19, 2024
973264d
adding liquid waste to protocols
rclarke0 Nov 19, 2024
d6a1293
abr6 protocol draft
rclarke0 Nov 20, 2024
ff0e778
abr6 liquid setup, tc lid trash parameter
rclarke0 Nov 20, 2024
bf639da
liquid waste probing at end of protocols
rclarke0 Nov 27, 2024
4983d6f
Merge branch 'edge' into abr-dvt1abr4-protocol
rclarke0 Nov 27, 2024
9411fe0
protocol fixeS
rclarke0 Dec 2, 2024
afb6f35
Merge branch 'abr-dvt1abr4-protocol' of https://github.com/Opentrons/…
rclarke0 Dec 2, 2024
39d850a
fix(abr_testing): fix to abr12 and abr6 liquid setup protocols)
AnthonyNASC20 Dec 3, 2024
0734105
Merge branch 'abr-dvt1abr4-protocol' of https://github.com/Opentrons/…
AnthonyNASC20 Dec 3, 2024
c0f1bbf
clean up plate function, longer pvt1abr9
rclarke0 Dec 4, 2024
c83dd09
pvt1abr12 merge issues
rclarke0 Dec 4, 2024
57a59b6
updates for abr1, abr2, abr3, abr4, abr8, reverted abr12
rclarke0 Dec 6, 2024
0bc81f6
abr10 updates
rclarke0 Dec 6, 2024
f728d58
dvt1abr1 protocol fixes
rclarke0 Dec 6, 2024
edea768
abr5 and abr10 fixes
rclarke0 Dec 10, 2024
441594d
abr10 fixes
rclarke0 Dec 11, 2024
7e9727d
abr3 protocol fixes, removed pauses
rclarke0 Dec 11, 2024
8b79691
fill liquid waste from top
rclarke0 Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 5 additions & 23 deletions abr-testing/abr_testing/data_collection/abr_google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ def create_data_dictionary(
runs_to_save: Union[Set[str], str],
storage_directory: str,
issue_url: str,
plate: str,
accuracy: Any,
hellma_plate_standards: List[Dict[str, Any]],
) -> Tuple[List[List[Any]], List[str], List[List[Any]], List[str], List[List[Any]]]:
) -> Tuple[List[List[Any]], List[str], List[List[Any]], List[str]]:
"""Pull data from run files and format into a dictionary."""
runs_and_robots: List[Any] = []
runs_and_lpc: List[Dict[str, Any]] = []
headers: List[str] = []
headers_lpc: List[str] = []
list_of_heights: List[List[Any]] = [[], [], [], [], [], [], [], []]
hellma_plate_orientation = False # default hellma plate is not rotated.
for filename in os.listdir(storage_directory):
file_path = os.path.join(storage_directory, filename)
Expand Down Expand Up @@ -130,13 +127,10 @@ def create_data_dictionary(
plate_reader_dict = read_robot_logs.plate_reader_commands(
file_results, hellma_plate_standards, hellma_plate_orientation
)
list_of_heights = read_robot_logs.liquid_height_commands(
file_results, list_of_heights
)
notes = {"Note1": "", "Jira Link": issue_url}
liquid_height = read_robot_logs.get_liquid_waste_height(file_results)
plate_measure = {
"Plate Measured": plate,
"End Volume Accuracy (%)": accuracy,
"Liquid Waste Height (mm)": liquid_height,
"Average Temp (oC)": "",
"Average RH(%)": "",
}
Expand Down Expand Up @@ -173,7 +167,6 @@ def create_data_dictionary(
headers,
transposed_runs_and_lpc,
headers_lpc,
list_of_heights,
)


Expand Down Expand Up @@ -211,26 +204,15 @@ def run(
headers,
transposed_runs_and_lpc,
headers_lpc,
list_of_heights,
) = create_data_dictionary(
missing_runs_from_gs,
storage_directory,
"",
"",
"",
hellma_plate_standards=file_values,
file_values,
)
start_row = google_sheet.get_index_row() + 1
google_sheet.batch_update_cells(transposed_runs_and_robots, "A", start_row, "0")
# Record Liquid Heights Found
google_sheet_ldf = google_sheets_tool.google_sheet(
credentials_path, google_sheet_name, 2
)
google_sheet_ldf.get_row(1)
start_row_lhd = google_sheet_ldf.get_index_row() + 1
google_sheet_ldf.batch_update_cells(
list_of_heights, "A", start_row_lhd, "2075262446"
)

# Add LPC to google sheet
google_sheet_lpc = google_sheets_tool.google_sheet(credentials_path, "ABR-LPC", 0)
start_row_lpc = google_sheet_lpc.get_index_row() + 1
Expand Down
14 changes: 1 addition & 13 deletions abr-testing/abr_testing/data_collection/abr_robot_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,28 +614,16 @@ def get_run_error_info_from_robot(
headers,
runs_and_lpc,
headers_lpc,
list_of_heights,
) = abr_google_drive.create_data_dictionary(
run_id,
error_folder_path,
issue_url,
"",
"",
hellma_plate_standards=file_values,
file_values,
)

start_row = google_sheet.get_index_row() + 1
google_sheet.batch_update_cells(runs_and_robots, "A", start_row, "0")
print("Wrote run to ABR-run-data")
# Record Liquid Heights Found
google_sheet_ldf = google_sheets_tool.google_sheet(
credentials_path, google_sheet_name, 4
)
start_row_lhd = google_sheet_ldf.get_index_row() + 1
google_sheet_ldf.batch_update_cells(
list_of_heights, "A", start_row_lhd, "1795535088"
)
print("wrote liquid heights found.")
# Add LPC to google sheet
google_sheet_lpc = google_sheets_tool.google_sheet(
credentials_path, "ABR-LPC", 0
Expand Down
57 changes: 44 additions & 13 deletions abr-testing/abr_testing/data_collection/read_robot_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def match_pipette_to_action(
left_pipette_add = 0
for command in commandTypes:
command_type = command_dict["commandType"]
command_pipette = command_dict.get("pipetteId", "")
command_params = command_dict.get("params", "")
command_pipette = command_params.get("pipetteId", "")
if command_type == command and command_pipette == right_pipette:
right_pipette_add = 1
elif command_type == command and command_pipette == left_pipette:
Expand Down Expand Up @@ -213,13 +214,32 @@ def instrument_commands(
return pipette_dict


def get_liquid_waste_height(file_results: Dict[str, Any]) -> float:
"""Find liquid waste height."""
commandData = file_results.get("commands", "")
height_float = 0.0
for command in commandData:
commandType = command["commandType"]
if commandType == "comment":
result = command["params"].get("message", "")
try:
height = result.split("Liquid Waste Total Height: ")[1]
height_float = float(height)
except IndexError:
continue
return height_float


def liquid_height_commands(
file_results: Dict[str, Any], all_heights_list: List[List[Any]]
) -> List[List[Any]]:
"""Record found liquid heights during a protocol."""
commandData = file_results.get("commands", "")
robot = file_results.get("robot_name", "")
run_id = file_results.get("run_id", "")
list_of_heights = []
print(robot)
liquid_waste_height = 0.0
for command in commandData:
commandType = command["commandType"]
if commandType == "comment":
Expand All @@ -236,16 +256,24 @@ def liquid_height_commands(
well_location = str(entry.split(", ")[1].split(" ")[0])
slot_location = str(entry.split("slot ")[1].split(")")[0])
labware_name = str(entry.split("of ")[1].split(" on")[0])
all_heights_list[0].append(robot)
all_heights_list[1].append(run_id)
all_heights_list[2].append(comment_time)
all_heights_list[3].append(labware_type)
all_heights_list[4].append(labware_name)
all_heights_list[5].append(slot_location)
all_heights_list[6].append(well_location)
all_heights_list[7].append(height)
if labware_name == "Liquid Waste":
liquid_waste_height += height
one_entry = {
"Timestamp": comment_time,
"Labware Name": labware_name,
"Labware Type": labware_type,
"Slot Location": slot_location,
"Well Location": well_location,
"All Heights (mm)": height,
}
list_of_heights.append(one_entry)
except (IndexError, ValueError):
continue
if len(list_of_heights) > 0:
all_heights_list[0].append(robot)
all_heights_list[1].append(run_id)
all_heights_list[2].append(list_of_heights)
all_heights_list[3].append(liquid_waste_height)
return all_heights_list


Expand Down Expand Up @@ -281,10 +309,13 @@ def plate_reader_commands(
read = "yes"
elif read == "yes" and commandType == "comment":
result = command["params"].get("message", "")
if "result:" in result:
plate_name = result.split("result:")[0]
formatted_result = result.split("result: ")[1]
print(formatted_result)
if "result:" in result or "Result:" in result:
try:
plate_name = result.split("result:")[0]
formatted_result = result.split("result: ")[1]
except IndexError:
plate_name = result.split("Result:")[0]
formatted_result = result.split("Result: ")[1]
result_dict = eval(formatted_result)
result_dict_keys = list(result_dict.keys())
if len(result_dict_keys) > 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@
header,
runs_and_lpc,
lpc_headers,
list_of_heights,
) = abr_google_drive.create_data_dictionary(
run_ids_in_storage,
run_log_file_path,
"",
"",
"",
hellma_plate_standards=file_values,
file_values,
)
print("list_of_heights not recorded.")
transposed_list = list(zip(*runs_and_robots))
Expand Down
Loading