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): ABR Testing Plate Reader Documentation #16329

Merged
merged 33 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cde88cb
increase google sheet columns
rclarke0 Jul 23, 2024
e534a8f
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 23, 2024
e200e8c
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 24, 2024
022dcb0
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 24, 2024
0cbcd1b
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 25, 2024
9628c49
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 29, 2024
9f2d693
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 30, 2024
728c2e1
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 31, 2024
31d0596
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
2bbcc3e
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
916f496
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
ebf6c72
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 2, 2024
56aa6dd
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 6, 2024
17cadc6
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 7, 2024
378ae28
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 9, 2024
68d6778
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 9, 2024
43fcb8a
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 13, 2024
7ed3f7d
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 13, 2024
7fda077
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 14, 2024
d40b067
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 20, 2024
0f0d482
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 20, 2024
02f92cb
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 22, 2024
a50bb16
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 27, 2024
20a4087
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 3, 2024
3a5d003
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 5, 2024
4b80358
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 5, 2024
7dc9204
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 9, 2024
d7ee6d4
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 10, 2024
c9dfbf6
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 16, 2024
293ba96
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 16, 2024
be60ffb
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 18, 2024
31c2e60
feat(abr-testing): plate reader data collection
rclarke0 Sep 19, 2024
fb70828
feat(abr-testing): data recording for plate reader
rclarke0 Sep 23, 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
2 changes: 1 addition & 1 deletion abr-testing/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ slackclient = "*"
slack-sdk = "*"
pandas = "*"
pandas-stubs = "*"

numpy = "==1.8.3"

[dev-packages]
atomicwrites = "==1.4.1"
Expand Down
115 changes: 60 additions & 55 deletions abr-testing/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions abr-testing/abr_testing/automation/google_sheets_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ def get_sheet_by_name(self, title: str) -> None:

def token_check(self) -> None:
"""Check if credentials are still valid and refresh if expired."""
if self.credentials.expired:
self.credentials.refresh() # Refresh the credentials
if self.credentials.access_token_expired:
self.gc.login() # Refresh the credentials

def get_row_index_with_value(self, some_string: str, col_num: int) -> Any:
"""Find row index of string by looking in specific column."""
Expand Down
20 changes: 18 additions & 2 deletions abr-testing/abr_testing/data_collection/abr_google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from abr_testing.data_collection import read_robot_logs
from typing import Set, Dict, Any, Tuple, List, Union
from abr_testing.automation import google_drive_tool, google_sheets_tool
from abr_testing.tools import sync_abr_sheet
from abr_testing.tools import sync_abr_sheet, plate_reader


def get_modules(file_results: Dict[str, str]) -> Dict[str, Any]:
Expand All @@ -17,6 +17,7 @@ def get_modules(file_results: Dict[str, str]) -> Dict[str, Any]:
"temperatureModuleV2",
"magneticBlockV1",
"thermocyclerModuleV2",
"absorbanceReaderV1",
)
all_modules = {key: "" for key in modList}
for module in file_results.get("modules", []):
Expand All @@ -35,6 +36,7 @@ def create_data_dictionary(
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]]:
"""Pull data from run files and format into a dictionary."""
runs_and_robots: List[Any] = []
Expand Down Expand Up @@ -113,6 +115,9 @@ def create_data_dictionary(
hs_dict = read_robot_logs.hs_commands(file_results)
tm_dict = read_robot_logs.temperature_module_commands(file_results)
pipette_dict = read_robot_logs.instrument_commands(file_results)
plate_reader_dict = read_robot_logs.plate_reader_commands(
file_results, hellma_plate_standards
)
notes = {"Note1": "", "Jira Link": issue_url}
plate_measure = {
"Plate Measured": plate,
Expand All @@ -132,6 +137,7 @@ def create_data_dictionary(
**hs_dict,
**tm_dict,
**tc_dict,
**plate_reader_dict,
**pipette_dict,
**plate_measure,
}
Expand Down Expand Up @@ -181,6 +187,7 @@ def create_data_dictionary(
storage_directory = args.storage_directory[0]
google_sheet_name = args.google_sheet_name[0]
email = args.email[0]

try:
credentials_path = os.path.join(storage_directory, "credentials.json")
except FileNotFoundError:
Expand All @@ -203,13 +210,22 @@ def create_data_dictionary(
missing_runs_from_gs = read_robot_logs.get_unseen_run_ids(
run_ids_on_gd, run_ids_on_gs
)
# Read Hellma Files
file_values = plate_reader.read_hellma_plate_files(storage_directory, 101934)
# Add missing runs to google sheet
(
transposed_runs_and_robots,
headers,
transposed_runs_and_lpc,
headers_lpc,
) = create_data_dictionary(missing_runs_from_gs, storage_directory, "", "", "")
) = create_data_dictionary(
missing_runs_from_gs,
storage_directory,
"",
"",
"",
hellma_plate_standards=file_values,
)
start_row = google_sheet.get_index_row() + 1
print(start_row)
google_sheet.batch_update_cells(transposed_runs_and_robots, "A", start_row, "0")
Expand Down
11 changes: 10 additions & 1 deletion abr-testing/abr_testing/data_collection/abr_robot_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import re
import pandas as pd
from statistics import mean, StatisticsError
from abr_testing.tools import plate_reader


def compare_current_trh_to_average(
Expand Down Expand Up @@ -590,13 +591,21 @@ def get_run_error_info_from_robot(
except FileNotFoundError:
print("Run file not uploaded.")
run_id = os.path.basename(error_run_log).split("_")[1].split(".")[0]
# Get hellma readings
file_values = plate_reader.read_hellma_plate_files(storage_directory, 101934)

(
runs_and_robots,
headers,
runs_and_lpc,
headers_lpc,
) = abr_google_drive.create_data_dictionary(
run_id, error_folder_path, issue_url, "", ""
run_id,
error_folder_path,
issue_url,
"",
"",
hellma_plate_standards=file_values,
)

start_row = google_sheet.get_index_row() + 1
Expand Down
2 changes: 1 addition & 1 deletion abr-testing/abr_testing/data_collection/get_run_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_run_data(one_run: Any, ip: str) -> Dict[str, Any]:
params={"cursor": cursor, "pageLength": page_length},
)
command_data = response.json()
commands.extend(command_data["data"])
commands.extend(command_data.get("data", ""))
run["commands"] = commands
response = requests.get(
f"http://{ip}:31950/runs/{one_run}", headers={"opentrons-version": "3"}
Expand Down
Loading
Loading