From 46f3d2163282f26d353edaad1cfbed6127523e18 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Fri, 27 Jun 2025 10:47:13 +0000 Subject: [PATCH] Apply suggestions from code review of branch fast-stack Co-authored-by: Beth Probert --- src/openflexure_microscope_server/things/autofocus.py | 9 +++++---- tests/test_camera_buffer.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/openflexure_microscope_server/things/autofocus.py b/src/openflexure_microscope_server/things/autofocus.py index 3fb7a699..c776c1bc 100644 --- a/src/openflexure_microscope_server/things/autofocus.py +++ b/src/openflexure_microscope_server/things/autofocus.py @@ -101,8 +101,8 @@ class StackParams: def stack_z_range(self) -> int: """The range of the z stack, in steps - Note that this is the range of the minimum number of image captured, - which is also the range of the images sored in memory that can be + Note that this is the range of the minimum number of images captured, + which is also the range of the images stored in memory that can be saved.""" return self.stack_dz * (self.min_images_to_test - 1) @@ -147,7 +147,7 @@ class CaptureInfo: @property def filename(self) -> str: - """The filename for this image generated from the poistion""" + """The filename for this image generated from the position""" return f"{self.position['x']}_{self.position['y']}_{self.position['z']}.jpeg" @@ -488,7 +488,8 @@ class AutofocusThing(Thing): cam=cam, ) - # Return the z position of the sharpest image, for path planning and tracking + # Return whether or not the smart stack was successful, and the z position of + # the sharpest image, for path planning and tracking return success, _get_capture_by_id(captures, sharpest_id).position["z"] def reset_stack( diff --git a/tests/test_camera_buffer.py b/tests/test_camera_buffer.py index b228dc07..f8e7f30a 100644 --- a/tests/test_camera_buffer.py +++ b/tests/test_camera_buffer.py @@ -27,8 +27,8 @@ def random_image(): def random_metadata(): """Create a misc dictionary to pretend to be metadata""" - # Not very metadata like, but we are just checking that the same dict it is - # returned + # Not very metadata like, but we are just checking that the same dict it + # is returned return {"a": randint(1, 100), "b": randint(1, 100)}