Skip to content

Commit

Permalink
Merge branch 'edge' into abr-jira-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rclarke0 authored Nov 21, 2024
2 parents f2ba138 + a166bc3 commit fb479ca
Show file tree
Hide file tree
Showing 678 changed files with 25,477 additions and 5,084 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/analyses-snapshot-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
env:
BASE_IMAGE_NAME: opentrons-python-base:3.10
ANALYSIS_REF: ${{ github.event.inputs.ANALYSIS_REF || github.head_ref || 'edge' }}
SNAPSHOT_REF: ${{ github.event.inputs.SNAPSHOT_REF || github.head_ref || 'edge' }}
# If we're running because of workflow_dispatch, use the user input to decide
# whether to open a PR on failure. Otherwise, there is no user input,
# so we only open a PR if the PR has the label 'gen-analyses-snapshot-pr'
OPEN_PR_ON_FAILURE: ${{ (github.event_name == 'workflow_dispatch' && github.events.inputs.OPEN_PR_ON_FAILURE) || ((github.event_name != 'workflow_dispatch') && (contains(github.event.pull_request.labels.*.name, 'gen-analyses-snapshot-pr'))) }}
OPEN_PR_ON_FAILURE: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.OPEN_PR_ON_FAILURE) || ((github.event_name != 'workflow_dispatch') && (contains(github.event.pull_request.labels.*.name, 'gen-analyses-snapshot-pr'))) }}
PR_TARGET_BRANCH: ${{ github.event.pull_request.base.ref || 'not a pr'}}
steps:
- name: Checkout Repository
Expand All @@ -71,9 +72,24 @@ jobs:
echo "Analyses snapshots match ${{ env.PR_TARGET_BRANCH }} snapshots."
fi
- name: Docker Build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build base image
id: build_base_image
uses: docker/build-push-action@v6
with:
context: analyses-snapshot-testing/citools
file: analyses-snapshot-testing/citools/Dockerfile.base
push: false
load: true
tags: ${{ env.BASE_IMAGE_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build analysis image
working-directory: analyses-snapshot-testing
run: make build-opentrons-analysis
run: make build-opentrons-analysis BASE_IMAGE_NAME=${{ env.BASE_IMAGE_NAME }} ANALYSIS_REF=${{ env.ANALYSIS_REF }} CACHEBUST=${{ github.run_number }}

- name: Set up Python 3.13
uses: actions/setup-python@v5
Expand Down Expand Up @@ -112,8 +128,8 @@ jobs:
commit-message: 'fix(analyses-snapshot-testing): heal analyses snapshots'
title: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
body: 'This PR was requested on the PR https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF}}'
base: ${{ env.SNAPSHOT_REF}}
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF }}'
base: ${{ env.SNAPSHOT_REF }}

- name: Comment on feature PR
if: always() && steps.create_pull_request.outcome == 'success' && github.event_name == 'pull_request'
Expand All @@ -135,5 +151,5 @@ jobs:
commit-message: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
title: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
body: 'The ${{ env.ANALYSIS_REF }} overnight analyses snapshot test is failing. This PR was opened to alert us to the failure.'
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF}}'
base: ${{ env.SNAPSHOT_REF}}
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF }}'
base: ${{ env.SNAPSHOT_REF }}
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
6 changes: 5 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 @@ -48,7 +48,11 @@ def create_data_dictionary(
file_path = os.path.join(storage_directory, filename)
if file_path.endswith(".json"):
with open(file_path) as file:
file_results = json.load(file)
try:
file_results = json.load(file)
except json.decoder.JSONDecodeError:
print(f"Skipped file {file_path} bc no data.")
continue
else:
continue
if not isinstance(file_results, dict):
Expand Down
5 changes: 3 additions & 2 deletions abr-testing/abr_testing/data_collection/get_run_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_run_ids_from_robot(ip: str) -> Set[str]:
f"http://{ip}:31950/runs", headers={"opentrons-version": "3"}
)
run_data = response.json()
run_list = run_data["data"]
run_list = run_data.get("data", "")
except requests.exceptions.RequestException:
print(f"Could not connect to robot with IP {ip}")
run_list = []
Expand Down 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
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 @@ -17,7 +17,7 @@
"protocolName": "Flex ZymoBIOMICS Magbead DNA Extraction: Cells",
}

requirements = {"robotType": "OT-3", "apiLevel": "2.20"}
requirements = {"robotType": "OT-3", "apiLevel": "2.21"}
"""
Slot A1: Tips 1000
Slot A2: Tips 1000
Expand Down Expand Up @@ -94,7 +94,6 @@ def run(ctx: protocol_api.ProtocolContext) -> None:
bind_time_1 = bind_time_2 = wash_time = 0.25
drybeads = 0.5
lysis_rep_1 = lysis_rep_2 = bead_reps_2 = 1
PK_vol = 20.0
bead_vol = 25.0
starting_vol = lysis_vol + sample_vol
binding_buffer_vol = bind_vol + bead_vol
Expand Down Expand Up @@ -137,7 +136,7 @@ def run(ctx: protocol_api.ProtocolContext) -> None:
"""
lysis_ = res1.wells()[0]
binding_buffer = res1.wells()[1:4]
bind2_res = res1.wells()[4:6]
bind2_res = res1.wells()[4:8]
wash1 = res1.wells()[6:8]
elution_solution = res1.wells()[-1]
wash2 = res2.wells()[:6]
Expand All @@ -149,16 +148,12 @@ def run(ctx: protocol_api.ProtocolContext) -> None:
samps = sample_plate.wells()[: (8 * num_cols)]

liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = {
"Lysis": [{"well": lysis_, "volume": lysis_vol}],
"PK": [{"well": lysis_, "volume": PK_vol}],
"Beads": [{"well": binding_buffer, "volume": bead_vol}],
"Binding": [{"well": binding_buffer, "volume": bind_vol}],
"Binding 2": [{"well": bind2_res, "volume": bind2_vol}],
"Wash 1": [{"well": wash1_vol, "volume": wash1}],
"Wash 2": [{"well": wash2_vol, "volume": wash2}],
"Wash 3": [{"well": wash3_vol, "volume": wash3}],
"Final Elution": [{"well": elution_solution, "volume": elution_vol}],
"Samples": [{"well": samps, "volume": 0}],
"Lysis and PK": [{"well": lysis_, "volume": 12320.0}],
"Beads and Binding": [{"well": binding_buffer, "volume": 11875.0}],
"Binding 2": [{"well": bind2_res, "volume": 13500.0}],
"Final Elution": [{"well": elution_solution, "volume": 52000}],
"Samples": [{"well": samps, "volume": 0.0}],
"Reagents": [{"well": res2.wells(), "volume": 9000.0}],
}
flattened_list_of_wells = helpers.find_liquid_height_of_loaded_liquids(
ctx, liquid_vols_and_wells, m1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

requirements = {
"robotType": "OT-3",
"apiLevel": "2.20",
"apiLevel": "2.21",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"author": "Your Name <[email protected]>",
}

requirements = {"robotType": "Flex", "apiLevel": "2.20"}
requirements = {"robotType": "Flex", "apiLevel": "2.21"}

tt_50 = 0
tt_200 = 0
Expand Down Expand Up @@ -50,6 +50,7 @@ def add_parameters(parameters: ParameterContext) -> None:
default=False,
)
helpers.create_disposable_lid_parameter(parameters)
helpers.create_tc_lid_deck_riser_parameter(parameters)
helpers.create_two_pipette_mount_parameters(parameters)
parameters.add_int(
variable_name="num_samples",
Expand Down Expand Up @@ -85,6 +86,7 @@ def run(ctx: ProtocolContext) -> None:
dry_run = ctx.params.dry_run # type: ignore[attr-defined]
pipette_1000_mount = ctx.params.pipette_mount_1 # type: ignore[attr-defined]
pipette_50_mount = ctx.params.pipette_mount_2 # type: ignore[attr-defined]
deck_riser = ctx.params.deck_riser # type: ignore[attr-defined]
REUSE_ETOH_TIPS = True
REUSE_RSB_TIPS = (
True # Reuse tips for RSB buffer (adding RSB, mixing, and transferring)
Expand Down Expand Up @@ -158,7 +160,7 @@ def run(ctx: ProtocolContext) -> None:
unused_lids: List[Labware] = []
# Load TC Lids
if disposable_lid:
unused_lids = helpers.load_disposable_lids(ctx, 5, ["C3"])
unused_lids = helpers.load_disposable_lids(ctx, 5, ["C3"], deck_riser)
# Import Global Variables

global tip50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

requirements = {
"robotType": "Flex",
"apiLevel": "2.20",
"apiLevel": "2.21",
}


Expand Down Expand Up @@ -121,8 +121,6 @@ def run(protocol: ProtocolContext) -> None:
style=SINGLE, start="H1", tip_racks=[tiprack_x_1, tiprack_x_2, tiprack_x_3]
)
helpers.find_liquid_height_of_all_wells(protocol, p1000, wells)
tiprack_x_1.reset()

sample_quant_csv = """
sample_plate_1, Sample_well,DYE,DILUENT
sample_plate_1,A1,0,100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@
"protocolName": "PCR Protocol with TC Auto Sealing Lid",
"author": "Rami Farawi <[email protected]",
}
requirements = {"robotType": "OT-3", "apiLevel": "2.20"}
requirements = {"robotType": "OT-3", "apiLevel": "2.21"}


def add_parameters(parameters: ParameterContext) -> None:
"""Parameters."""
helpers.create_single_pipette_mount_parameter(parameters)
helpers.create_disposable_lid_parameter(parameters)
helpers.create_csv_parameter(parameters)
helpers.create_tc_lid_deck_riser_parameter(parameters)


def run(ctx: ProtocolContext) -> None:
"""Protocol."""
pipette_mount = ctx.params.pipette_mount # type: ignore[attr-defined]
disposable_lid = ctx.params.disposable_lid # type: ignore[attr-defined]
parsed_csv = ctx.params.parameters_csv.parse_as_csv() # type: ignore[attr-defined]
deck_riser = ctx.params.deck_riser # type: ignore[attr-defined]

rxn_vol = 50
real_mode = True
# DECK SETUP AND LABWARE
Expand Down Expand Up @@ -60,7 +63,7 @@ def run(ctx: ProtocolContext) -> None:

# Opentrons tough pcr auto sealing lids
if disposable_lid:
unused_lids = helpers.load_disposable_lids(ctx, 3, ["C3"])
unused_lids = helpers.load_disposable_lids(ctx, 3, ["C3"], deck_riser)
used_lids: List[Labware] = []

# LOAD PIPETTES
Expand Down Expand Up @@ -205,4 +208,6 @@ def run(ctx: ProtocolContext) -> None:
ctx.move_labware(lid_on_plate, "C2", use_gripper=True)
else:
ctx.move_labware(lid_on_plate, used_lids[-2], use_gripper=True)
p50.drop_tip()
p50.configure_nozzle_layout(style=SINGLE, start="A1", tip_racks=tiprack_50)
helpers.find_liquid_height_of_all_wells(ctx, p50, wells_to_probe_flattened)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": "Protocol Library",
}

requirements = {"robotType": "Flex", "apiLevel": "2.20"}
requirements = {"robotType": "Flex", "apiLevel": "2.21"}

# SCRIPT SETTINGS
ABR_TEST = True
Expand Down Expand Up @@ -340,5 +340,4 @@ def run(ctx: ProtocolContext) -> None:
)

current += 1
print(wells_with_liquids)
helpers.find_liquid_height_of_all_wells(ctx, p50, wells_with_liquids)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

requirements = {
"robotType": "OT-3",
"apiLevel": "2.20",
"apiLevel": "2.21",
}


Expand All @@ -44,13 +44,15 @@ def add_parameters(parameters: ParameterContext) -> None:
helpers.create_tip_size_parameter(parameters)
helpers.create_dot_bottom_parameter(parameters)
helpers.create_disposable_lid_parameter(parameters)
helpers.create_tc_lid_deck_riser_parameter(parameters)


def run(ctx: ProtocolContext) -> None:
"""Protocol."""
b = ctx.params.dot_bottom # type: ignore[attr-defined]
TIPRACK_96_NAME = ctx.params.tip_size # type: ignore[attr-defined]
disposable_lid = ctx.params.disposable_lid # type: ignore[attr-defined]
deck_riser = ctx.params.deck_riser # type: ignore[attr-defined]

waste_chute = ctx.load_waste_chute()

Expand All @@ -61,7 +63,7 @@ def run(ctx: ProtocolContext) -> None:
helpers.temp_str, "C1"
) # type: ignore[assignment]
if disposable_lid:
unused_lids = helpers.load_disposable_lids(ctx, 3, ["A4"])
unused_lids = helpers.load_disposable_lids(ctx, 3, ["A4"], deck_riser)
used_lids: List[Labware] = []
thermocycler.open_lid()
h_s.open_labware_latch()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

requirements = {
"robotType": "OT-3",
"apiLevel": "2.20",
"apiLevel": "2.21",
}
"""
Slot A1: Tips 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

requirements = {
"robotType": "OT-3",
"apiLevel": "2.20",
"apiLevel": "2.21",
}
"""
Slot A1: Tips 200
Expand Down

This file was deleted.

Loading

0 comments on commit fb479ca

Please sign in to comment.