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

fix(api): calibration z checking needs <= #12550

Merged
merged 1 commit into from
Apr 24, 2023
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
2 changes: 1 addition & 1 deletion api/src/opentrons/hardware_control/ot3_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def find_calibration_structure_height(
z_prep_point = nominal_center + PREP_OFFSET_DEPTH
structure_z = await _probe_deck_at(hcapi, mount, z_prep_point, z_pass_settings)
z_limit = nominal_center.z - z_pass_settings.max_overrun_distance_mm
if isclose(z_limit, structure_z, abs_tol=0.001):
if (structure_z < z_limit) or isclose(z_limit, structure_z, abs_tol=0.001):
raise CalibrationStructureNotFoundError(structure_z, z_limit)
LOG.info(f"autocalibration: found structure at {structure_z}")
return structure_z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ async def test_calibrate_mount_errors(
ot3_hardware.managed_obj, "reset_instrument_offset", AsyncMock()
) as reset_instrument_offset, patch.object(
ot3_hardware.managed_obj, "save_instrument_offset", AsyncMock()
) as save_instrument_offset:
) as save_instrument_offset, patch(
"opentrons.hardware_control.ot3_calibration.find_calibration_structure_height",
AsyncMock(spec=find_calibration_structure_height),
) as find_deck:
find_deck.return_value = 10
mock_data_analysis.return_value = (-1000, 1000)

await ot3_hardware.home()
Expand Down