Skip to content

Commit

Permalink
chore(release): Merge branch 'edge' into merge_release_820_into_edge
Browse files Browse the repository at this point in the history
Resolve conflicts in:
* api/src/opentrons/hardware_control/ot3api.py
* api/src/opentrons/protocol_engine/commands/drop_tip.py
  • Loading branch information
SyntaxColoring committed Nov 22, 2024
2 parents 8e84bb4 + 9404144 commit 2c326c1
Show file tree
Hide file tree
Showing 483 changed files with 14,171 additions and 2,252 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ push:
sleep 1
$(MAKE) -C $(UPDATE_SERVER_DIR) push

.PHONY: push-folder
PUSH_HELPER := abr-testing/abr_testing/tools/make_push.py
push-folder:
$(OT_PYTHON) $(PUSH_HELPER)

.PHONY: push-ot3
push-ot3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def run(
ip_json_file = os.path.join(storage_directory, "IPs.json")
try:
ip_file = json.load(open(ip_json_file))
robot_dict = ip_file.get("ip_address_list")
except FileNotFoundError:
print(f"Add .json file with robot IPs to: {storage_directory}.")
sys.exit()
Expand All @@ -294,7 +295,7 @@ def run(
ip_or_all = input("IP Address or ALL: ")
calibration_data = []
if ip_or_all.upper() == "ALL":
ip_address_list = ip_file["ip_address_list"]
ip_address_list = list(robot_dict.keys())
for ip in ip_address_list:
saved_file_path, calibration = read_robot_logs.get_calibration_offsets(
ip, storage_directory
Expand Down
7 changes: 6 additions & 1 deletion abr-testing/abr_testing/data_collection/abr_google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def create_data_dictionary(
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)
if file_path.endswith(".json"):
Expand All @@ -67,6 +68,10 @@ def create_data_dictionary(
if run_id in runs_to_save:
print(f"started reading run {run_id}.")
robot = file_results.get("robot_name")
parameters = file_results.get("runTimeParameters", "")
for parameter in parameters:
if parameter["displayName"] == "Hellma Plate Orientation":
hellma_plate_orientation = bool(parameter["value"])
protocol_name = file_results["protocol"]["metadata"].get("protocolName", "")
software_version = file_results.get("API_Version", "")
left_pipette = file_results.get("left", "")
Expand Down Expand Up @@ -123,7 +128,7 @@ def create_data_dictionary(
file_results, labware_name="opentrons_tough_pcr_auto_sealing_lid"
)
plate_reader_dict = read_robot_logs.plate_reader_commands(
file_results, hellma_plate_standards
file_results, hellma_plate_standards, hellma_plate_orientation
)
list_of_heights = read_robot_logs.liquid_height_commands(
file_results, list_of_heights
Expand Down
3 changes: 2 additions & 1 deletion abr-testing/abr_testing/data_collection/get_run_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def get_all_run_logs(
ip_json_file = os.path.join(storage_directory, "IPs.json")
try:
ip_file = json.load(open(ip_json_file))
robot_dict = ip_file.get("ip_address_list")
except FileNotFoundError:
print(f"Add .json file with robot IPs to: {storage_directory}.")
sys.exit()
ip_address_list = ip_file["ip_address_list"]
ip_address_list = list(robot_dict.keys())
runs_from_storage = read_robot_logs.get_run_ids_from_google_drive(google_drive)
for ip in ip_address_list:
runs = get_run_ids_from_robot(ip)
Expand Down
72 changes: 41 additions & 31 deletions abr-testing/abr_testing/data_collection/read_robot_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def liquid_height_commands(


def plate_reader_commands(
file_results: Dict[str, Any], hellma_plate_standards: List[Dict[str, Any]]
file_results: Dict[str, Any],
hellma_plate_standards: List[Dict[str, Any]],
orientation: bool,
) -> Dict[str, object]:
"""Plate Reader Command Counts."""
commandData = file_results.get("commands", "")
Expand Down Expand Up @@ -279,38 +281,46 @@ def plate_reader_commands(
read = "yes"
elif read == "yes" and commandType == "comment":
result = command["params"].get("message", "")
formatted_result = result.split("result: ")[1]
result_dict = eval(formatted_result)
result_dict_keys = list(result_dict.keys())
if len(result_dict_keys) > 1:
read_type = "multi"
else:
read_type = "single"
for wavelength in result_dict_keys:
one_wavelength_dict = result_dict.get(wavelength)
result_ndarray = plate_reader.convert_read_dictionary_to_array(
one_wavelength_dict
)
for item in hellma_plate_standards:
wavelength_of_interest = item["wavelength"]
if str(wavelength) == str(wavelength_of_interest):
error_cells = plate_reader.check_byonoy_data_accuracy(
result_ndarray, item, False
if "result:" in result:
plate_name = result.split("result:")[0]
formatted_result = result.split("result: ")[1]
print(formatted_result)
result_dict = eval(formatted_result)
result_dict_keys = list(result_dict.keys())
if len(result_dict_keys) > 1:
read_type = "multi"
else:
read_type = "single"
if "hellma_plate" in plate_name:
for wavelength in result_dict_keys:
one_wavelength_dict = result_dict.get(wavelength)
result_ndarray = plate_reader.convert_read_dictionary_to_array(
one_wavelength_dict
)
if len(error_cells[0]) > 0:
percent = (96 - len(error_cells)) / 96 * 100
for cell in error_cells:
print(
"FAIL: Cell " + str(cell) + " out of accuracy spec."
for item in hellma_plate_standards:
wavelength_of_interest = item["wavelength"]
if str(wavelength) == str(wavelength_of_interest):
error_cells = plate_reader.check_byonoy_data_accuracy(
result_ndarray, item, orientation
)
else:
percent = 100
print(
f"PASS: {wavelength_of_interest} meet accuracy specification"
)
final_result[read_type, wavelength, read_num] = percent
read_num += 1
read = "no"
if len(error_cells[0]) > 0:
percent = (96 - len(error_cells)) / 96 * 100
for cell in error_cells:
print(
"FAIL: Cell "
+ str(cell)
+ " out of accuracy spec."
)
else:
percent = 100
print(
f"PASS: {wavelength_of_interest} meet accuracy spec."
)
final_result[read_type, wavelength, read_num] = percent
read_num += 1
else:
final_result = result_dict
read = "no"
plate_dict = {
"Plate Reader # of Reads": read_count,
"Plate Reader Avg Read Time (sec)": avg_read_time,
Expand Down
3 changes: 1 addition & 2 deletions abr-testing/abr_testing/protocol_simulation/abr_sim_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_files() -> Tuple[Dict[str, Dict[str, Union[str, Path]]], List[Path]]:
labware_defs = []
for root, directories, _ in os.walk(root_dir):
for directory in directories:
if directory == "active_protocols":
if directory not in exclude:
active_dir = os.path.join(root, directory)
for file in os.listdir(
active_dir
Expand Down Expand Up @@ -100,7 +100,6 @@ def get_files() -> Tuple[Dict[str, Dict[str, Union[str, Path]]], List[Path]]:
exclude = [
"__init__.py",
"helpers.py",
"shared_vars_and_funcs.py",
]
print("Simulating Protocols")
file_dict, labware_defs = get_files()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ def parse_results_volume(
else:
print(f"Expected JSON object (dict) but got {type(json_data).__name__}.")
commands = {}

hellma_plate_orientation = False
parameters = json_data.get("runTimeParameters", "")
for parameter in parameters:
if parameter["displayName"] == "Hellma Plate Orientation":
hellma_plate_orientation = bool(parameter["value"])
start_time = datetime.fromisoformat(commands[0]["createdAt"])
end_time = datetime.fromisoformat(commands[len(commands) - 1]["completedAt"])
header = ["", "Protocol Name", "Date", "Time"]
Expand Down Expand Up @@ -283,7 +287,7 @@ def parse_results_volume(
temp_module_dict = read_robot_logs.temperature_module_commands(json_data)
thermo_cycler_dict = read_robot_logs.thermocycler_commands(json_data)
plate_reader_dict = read_robot_logs.plate_reader_commands(
json_data, hellma_plate_standards
json_data, hellma_plate_standards, hellma_plate_orientation
)
instrument_dict = read_robot_logs.instrument_commands(
json_data, labware_name=None
Expand Down Expand Up @@ -499,12 +503,12 @@ def check_params(protocol_path: str) -> str:
def get_extra_files(protocol_file_path: str) -> tuple[str, List[Path]]:
"""Get supporting files for protocol simulation if needed."""
params = check_params(protocol_file_path)
needs_files = input("Does your protocol utilize custom labware? (y/n): ")
needs_files = input("Does your protocol utilize custom labware? (Y/N): ")
labware_files = []
if needs_files == "y":
if needs_files == "Y":
num_labware = input("How many custom labware?: ")
for labware_num in range(int(num_labware)):
path = input("Enter custom labware definition: ")
path = input("Enter custom labware definition path: ")
labware_files.append(Path(path))
return (params, labware_files)

Expand Down
Loading

0 comments on commit 2c326c1

Please sign in to comment.