Typehint added and import removed.

This commit is contained in:
Chish36 2025-08-06 16:51:20 +01:00 committed by Julian Stirling
parent 1afaa53413
commit ab9a324122

View file

@ -14,7 +14,6 @@ this is 10% of the expected motion is the measured axis.
"""
import numpy as np
import cv2
from typing import Literal
from PIL import Image
import time
@ -94,6 +93,7 @@ def _predict_z(
return z_dest - stage.position["z"]
def _move_and_measure(
step_size: dict[str, float],
axis: Literal["x", "y"],
@ -175,6 +175,7 @@ def _acquire_z_predict_points(
autofocus=autofocus,
cam=cam,
)
logger.info(f"Offset measured as {data.delta[axis]}")
data.measure(stage.position, offset)
@ -282,7 +283,7 @@ def _motion_detection(
stage: StageDep,
cam: CamDep,
logger: lt.deps.InvocationLogger,
) -> dict:
) -> dict[str, int]:
"""Move the stage until motion is detected along a specified axis and direction.
:params axis: The axis in which the stage is moving. This must be 'x' or 'y'.
@ -523,9 +524,9 @@ class RangeofMotionThing(lt.Thing):
direction=axis_dir[1],
)
# Save results from single axis and direction
rom_results[f"{'positive' if axis_dir[1] == 1 else 'negative'} {axis_dir[0]}"] = (
axis_dir_results
)
rom_results[
f"{'positive' if axis_dir[1] == 1 else 'negative'} {axis_dir[0]}"
] = axis_dir_results
end_time = time.time()
total_time = (end_time - start_time) / 60