Ruff formatting

This commit is contained in:
Chish36 2025-08-12 16:25:31 +01:00 committed by Julian Stirling
parent 773f19ee36
commit 094cb94da8
2 changed files with 6 additions and 3 deletions

View file

@ -35,6 +35,7 @@ CSMDep = lt.deps.direct_thing_client_dependency(
) )
AutofocusDep = lt.deps.direct_thing_client_dependency(AutofocusThing, "/autofocus/") AutofocusDep = lt.deps.direct_thing_client_dependency(AutofocusThing, "/autofocus/")
class RomDataTracker: class RomDataTracker:
"""Class for tracking range of motion data.""" """Class for tracking range of motion data."""
@ -59,6 +60,7 @@ class RomDataTracker:
self.stage_coords.clear() self.stage_coords.clear()
self.cor_lat_steps.clear() self.cor_lat_steps.clear()
class ParasiticMotionError(Exception): class ParasiticMotionError(Exception):
"""Custom exception raised when parasitic motion is detected. """Custom exception raised when parasitic motion is detected.
@ -221,7 +223,7 @@ def _acquire_z_predict_points(
data.measure(stage.position, offset) data.measure(stage.position, offset)
parasitic_detect( _parasitic_detect(
delta=abs(data.delta[wrong_axis]), delta=abs(data.delta[wrong_axis]),
max_allowed_delta=abs(wrong_axis_max_medium[wrong_axis]), max_allowed_delta=abs(wrong_axis_max_medium[wrong_axis]),
) )
@ -306,7 +308,7 @@ def _check_stage_operation(
data.measure(stage.position, offset) data.measure(stage.position, offset)
parasitic_detect( _parasitic_detect(
abs(data.delta[wrong_axis]), abs(data.delta[wrong_axis]),
abs( abs(
_generate_move_dicts( _generate_move_dicts(

View file

@ -5,7 +5,7 @@ from openflexure_microscope_server.things.stage_measure import (
_generate_move_dicts, _generate_move_dicts,
_predict_z, _predict_z,
_parasitic_detect, _parasitic_detect,
ParasiticMotionError ParasiticMotionError,
) )
from .mock_things.mock_csm import MockCSMThing from .mock_things.mock_csm import MockCSMThing
@ -49,6 +49,7 @@ def test_predict_z():
expected_z_diff = 1343.1625053206606 expected_z_diff = 1343.1625053206606
assert mock_z_diff == expected_z_diff assert mock_z_diff == expected_z_diff
def test_parasitic_detect(): def test_parasitic_detect():
"""Check that the parasitic error is raised correctly.""" """Check that the parasitic error is raised correctly."""
mock_delta = 100 mock_delta = 100