Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/edge' into EXEC-1055-96-chan-tes…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Dec 13, 2024
2 parents 979241b + 352e4ac commit bf63e7e
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 44 deletions.
46 changes: 21 additions & 25 deletions abr-testing/abr_testing/tools/make_push.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Push one or more folders to one or more robots."""
import subprocess
import multiprocessing
import json
from typing import List
from multiprocessing import Process, Queue

global folders
# Opentrons folders that can be pushed to robot
Expand All @@ -13,20 +14,22 @@
]


def push_subroutine(cmd: str) -> None:
def push_subroutine(cmd: str, queue: Queue) -> None:
"""Pushes specified folder to specified robot."""
try:
subprocess.run(cmd)
queue.put(f"{cmd}: SUCCESS!\n")
except Exception:
print("failed to push folder")
raise
queue.put(f"{cmd}: FAILED\n")


def main(folder_to_push: str, robot_to_push: str) -> int:
"""Main process!"""
cmd = "make -C {folder} push-ot3 host={ip}"
robot_ip_path = ""
push_cmd = ""
processes: List[Process] = []
queue: Queue = Queue()
folder_int = int(folder_to_push)
if folders[folder_int].lower() == "abr-testing + hardware-testing":
if robot_to_push.lower() == "all":
Expand All @@ -41,20 +44,16 @@ def main(folder_to_push: str, robot_to_push: str) -> int:
for folder_name in folders[:-2]:
# Push abr-testing and hardware-testing folders to all robots
for robot in robot_ips:
print_proc = multiprocessing.Process(
target=print, args=(f"Pushing {folder_name} to {robot}!\n\n",)
)
print_proc.start()
print_proc.join()
push_cmd = cmd.format(folder=folder_name, ip=robot)
process = multiprocessing.Process(
target=push_subroutine, args=(push_cmd,)
process = Process(
target=push_subroutine,
args=(
push_cmd,
queue,
),
)
process.start()
process.join()
print_proc = multiprocessing.Process(target=print, args=("Done!\n\n",))
print_proc.start()
print_proc.join()
processes.append(process)
else:

if folder_int == (len(folders) - 1):
Expand All @@ -72,18 +71,15 @@ def main(folder_to_push: str, robot_to_push: str) -> int:

# Push folder to robots
for robot in robot_ips:
print_proc = multiprocessing.Process(
target=print, args=(f"Pushing {folder_name} to {robot}!\n\n",)
)
print_proc.start()
print_proc.join()
push_cmd = cmd.format(folder=folder_name, ip=robot)
process = multiprocessing.Process(target=push_subroutine, args=(push_cmd,))
process = Process(target=push_subroutine, args=(push_cmd, queue))
process.start()
process.join()
print_proc = multiprocessing.Process(target=print, args=("Done!\n\n",))
print_proc.start()
print_proc.join()
processes.append(process)

for process in processes:
process.join()
result = queue.get()
print(f"\n{result}")
return 0


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down
2 changes: 2 additions & 0 deletions api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down Expand Up @@ -1535,6 +1536,7 @@ def response_capture(data: Dict[SensorId, List[SensorDataType]]) -> None:
threshold_pascals=threshold_pascals,
plunger_impulse_time=plunger_impulse_time,
num_baseline_reads=num_baseline_reads,
z_offset_for_plunger_prep=z_offset_for_plunger_prep,
sensor_id=sensor_id_for_instrument(probe),
force_both_sensors=force_both_sensors,
emplace_data=response_capture,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down
3 changes: 3 additions & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,7 @@ async def _liquid_probe_pass(
probe_settings: LiquidProbeSettings,
probe: InstrumentProbeType,
p_travel: float,
z_offset_for_plunger_prep: float,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
) -> float:
Expand All @@ -2689,6 +2690,7 @@ async def _liquid_probe_pass(
probe_settings.sensor_threshold_pascals,
probe_settings.plunger_impulse_time,
probe_settings.samples_for_baselining,
z_offset_for_plunger_prep,
probe=probe,
force_both_sensors=force_both_sensors,
response_queue=response_queue,
Expand Down Expand Up @@ -2838,6 +2840,7 @@ async def prep_plunger_for_probe_move(
probe_settings,
checked_probe,
plunger_travel_mm + sensor_baseline_plunger_move_mm,
z_offset_for_plunger_prep,
force_both_sensors,
response_queue,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ async def test_liquid_probe(
threshold_pascals=fake_liquid_settings.sensor_threshold_pascals,
plunger_impulse_time=fake_liquid_settings.plunger_impulse_time,
num_baseline_reads=fake_liquid_settings.samples_for_baselining,
z_offset_for_plunger_prep=2.0,
)
except PipetteLiquidNotFoundError:
# the move raises a liquid not found now since we don't call the move group and it doesn't
Expand Down
3 changes: 3 additions & 0 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ async def test_liquid_probe(
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.samples_for_baselining,
probe_safe_reset_mm,
probe=InstrumentProbeType.PRIMARY,
force_both_sensors=False,
response_queue=None,
Expand Down Expand Up @@ -1114,6 +1115,7 @@ async def test_multi_liquid_probe(
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.samples_for_baselining,
2.0,
probe=InstrumentProbeType.PRIMARY,
force_both_sensors=False,
response_queue=None,
Expand Down Expand Up @@ -1149,6 +1151,7 @@ async def _fake_pos_update_and_raise(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[
Expand Down
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ clean:
dist: export NODE_ENV := production
dist:
echo "Building app JS bundle (browser layer)"
vite build
NODE_OPTIONS="--max-old-space-size=8192" vite build

# development
#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ExternalLink } from '/app/atoms/Link/ExternalLink'
import { TertiaryButton } from '/app/atoms/buttons'
import { getRobotUpdateDisplayInfo } from '/app/redux/robot-update'
import { useDispatchStartRobotUpdate } from '/app/redux/robot-update/hooks'
import { remote } from '/app/redux/shell/remote'

import type { ChangeEventHandler, MouseEventHandler } from 'react'
import type { State } from '/app/redux/types'
Expand Down Expand Up @@ -55,14 +56,19 @@ export function UpdateRobotSoftware({

const handleChange: ChangeEventHandler<HTMLInputElement> = event => {
const { files } = event.target
if (files?.length === 1 && !updateDisabled) {
dispatchStartRobotUpdate(robotName, files[0].path)
onUpdateStart()
}
// this is to reset the state of the file picker so users can reselect the same
// system image if the upload fails
if (inputRef.current?.value != null) {
inputRef.current.value = ''

if (files != null) {
void remote.getFilePathFrom(files[0]).then(filePath => {
if (files.length === 1 && !updateDisabled) {
dispatchStartRobotUpdate(robotName, filePath)
onUpdateStart()
}
// this is to reset the state of the file picker so users can reselect the same
// system image if the upload fails
if (inputRef.current?.value != null) {
inputRef.current.value = ''
}
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"outDir": "lib",
"paths": {
"/app/*": ["./src/*"]
}
},
},
"include": ["typings", "src"],
"exclude": ["**/*.stories.tsx"]
Expand Down
1 change: 1 addition & 0 deletions app/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig(
build: {
// Relative to the root
outDir: 'dist',
sourcemap: true
},
plugins: [
react({
Expand Down
4 changes: 3 additions & 1 deletion hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
sensor_id: SensorId = SensorId.S0,
force_both_sensors: bool = False,
emplace_data: Optional[
Expand Down Expand Up @@ -331,8 +332,9 @@ async def liquid_probe(
)
sensor_runner = MoveGroupRunner(move_groups=[[lower_plunger], [sensor_group]])

# Only raise the z a little so we don't do a huge slow travel
raise_z = create_step(
distance={head_node: float64(max_z_distance)},
distance={head_node: float64(z_offset_for_plunger_prep)},
velocity={head_node: float64(-1 * mount_speed)},
acceleration={},
duration=float64(max_z_distance / mount_speed),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def move_responder(
threshold_pascals=threshold_pascals,
plunger_impulse_time=0.2,
num_baseline_reads=20,
z_offset_for_plunger_prep=2.0,
sensor_id=SensorId.S0,
)
assert position[motor_node].positions_only()[0] == 14
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'
import {
Expand Down Expand Up @@ -137,13 +136,6 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {

const mappedErrorsToField = getFormErrorsMappedToField(visibleFormErrors)

// auto-collapse blowout field if disposal volume is checked
useEffect(() => {
if (formData.disposalVolume_checkbox) {
propsForFields.blowout_checkbox.updateValue(false)
}
}, [formData.disposalVolume_checkbox])

return toolboxStep === 0 ? (
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const updatePatchDisposalVolumeFields = (
...patch,
disposalVolume_checkbox: true,
disposalVolume_volume: recommendedMinimumDisposalVol,
blowout_checkbox: false,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ describe('disposal volume should update...', () => {
dispense_mix_checkbox: false,
dispense_mix_times: null,
dispense_mix_volume: null,
blowout_checkbox: false,
})
})

Expand Down

0 comments on commit bf63e7e

Please sign in to comment.