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

ABR Robot, Pipette, Gripper Lifetime #15523

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion abr-testing/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ opentrons-hardware = {editable = true, path = "./../hardware", extras=['FLEX']}
opentrons = {editable = true, path = "./../api", extras=['flex-hardware']}
slackclient = "*"
slack-sdk = "*"
scikit-learn = "*"
pandas = "*"
pandas-stubs = "*"


[dev-packages]
atomicwrites = "==1.4.1"
Expand Down
77 changes: 48 additions & 29 deletions abr-testing/Pipfile.lock

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

13 changes: 8 additions & 5 deletions abr-testing/abr_testing/data_collection/abr_google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +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


def get_modules(file_results: Dict[str, str]) -> Dict[str, Any]:
Expand Down Expand Up @@ -184,10 +185,10 @@ def create_data_dictionary(
google_sheet = google_sheets_tool.google_sheet(
credentials_path, google_sheet_name, 0
)

run_ids_on_gs = google_sheet.get_column(2)
run_ids_on_gs = set(run_ids_on_gs)

# Get run ids on google sheet
run_ids_on_gs = set(google_sheet.get_column(2))
# Get robots on google sheet
robots = list(set(google_sheet.get_column(1)))
# Uploads files that are not in google drive directory
google_drive.upload_missing_files(storage_directory)

Expand All @@ -203,14 +204,16 @@ def create_data_dictionary(
transposed_runs_and_lpc,
headers_lpc,
) = create_data_dictionary(missing_runs_from_gs, storage_directory, "", "", "")

start_row = google_sheet.get_index_row() + 1
print(start_row)
google_sheet.batch_update_cells(transposed_runs_and_robots, "A", start_row, "0")
# Calculate Robot Lifetimes

# 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
google_sheet_lpc.batch_update_cells(
transposed_runs_and_lpc, "A", start_row_lpc, "0"
)
robots = list(set(google_sheet.get_column(1)))
sync_abr_sheet.determine_lifetime(google_sheet)
14 changes: 9 additions & 5 deletions abr-testing/abr_testing/data_collection/get_run_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
def get_run_ids_from_robot(ip: str) -> Set[str]:
"""Get all completed runs from each robot."""
run_ids = set()
response = requests.get(
f"http://{ip}:31950/runs", headers={"opentrons-version": "3"}
)
run_data = response.json()
run_list = run_data["data"]
try:
response = requests.get(
f"http://{ip}:31950/runs", headers={"opentrons-version": "3"}
)
run_data = response.json()
run_list = run_data["data"]
except requests.exceptions.RequestException:
print(f"Could not connect to robot with IP {ip}")
run_list = []
for run in run_list:
run_id = run["id"]
if not run["current"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def get_error_info(file_results: Dict[str, Any]) -> Tuple[int, str, str, str, st
error_type = run_command_error["error"].get("errorType", "")
if error_type == "PythonException":
# Reassign error_type to be more descriptive
error_type = run_command_error["detail"].split(":")[0]
error_type = run_command_error.get("detail", "").split(":")[0]
error_code = run_command_error["error"].get("errorCode", "")
try:
# Instrument Error
Expand Down
Loading
Loading