diff --git a/src/openflexure_microscope_server/things/stage_measure.py b/src/openflexure_microscope_server/things/stage_measure.py index f9e2c14c..9dcce848 100644 --- a/src/openflexure_microscope_server/things/stage_measure.py +++ b/src/openflexure_microscope_server/things/stage_measure.py @@ -61,7 +61,7 @@ class RomDataTracker: self.offsets: list[dict[str, float]] = [] def record_movement( - self, current_pos: dict[str, int], offset: dict[str, int] + self, current_pos: dict[str, int], offset: dict[str, float] ) -> None: """Record the current position and the measured offset of the last move.""" self.stage_coords.append(current_pos) @@ -76,7 +76,7 @@ class RomDataTracker: self, movement: dict[str, int], stage_position: dict[str, int], - csm_matrix: np.ndarray, + csm_matrix: list[list[int]], ) -> int: """Predict the z-displacement needed for a given movement. @@ -98,7 +98,6 @@ class RomDataTracker: z_dest = quadratic( stage_position[axis] + (movement[axis] / pixel_step[axis]), *fit_params ) - return int(z_dest - stage_position["z"]) @@ -192,7 +191,7 @@ class RangeofMotionThing(lt.Thing): return { "Time": total_time, - "CSM Matrix": csm.image_to_stage_displacement_matrix.tolist(), + "CSM Matrix": csm.image_to_stage_displacement_matrix, "Step Range": step_range, } diff --git a/tests/test_stage_measure.py b/tests/test_stage_measure.py index ced2962b..85460972 100644 --- a/tests/test_stage_measure.py +++ b/tests/test_stage_measure.py @@ -44,12 +44,10 @@ def increasing_xyz_dict_generator(*_args, **_kwargs): @pytest.fixture def csm_matrix(): """Return an example CSM matrix.""" - return np.array( - [ - [0.03061156624485296, 1.8031242270940833], - [1.773236372778601, 0.006660431608601435], - ] - ) + return [ + [0.03061156624485296, 1.8031242270940833], + [1.773236372778601, 0.006660431608601435], + ] @pytest.fixture