From f363ec0eff3286fb81b7c22c77d8a7597b98f895 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Tue, 17 Jun 2025 13:29:57 +0100 Subject: [PATCH] Docstring for test_stack --- src/openflexure_microscope_server/things/autofocus.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/autofocus.py b/src/openflexure_microscope_server/things/autofocus.py index 117e40b0..8f9b5039 100644 --- a/src/openflexure_microscope_server/things/autofocus.py +++ b/src/openflexure_microscope_server/things/autofocus.py @@ -387,7 +387,14 @@ class AutofocusThing(Thing): return heights[-images_to_test:][sharpest_index] def test_stack(self, sharpnesses: list): - """Test a list of sharpnesses, to decide whether the sharpest image from a stack is within them""" + """Test a list of sharpnesses, to decide whether the sharpest image from a stack is within them + + Returns a string + 'success' if the sharpest image is towards the centre + 'continue' if the sharpest image is in the final two images of the list + 'restart' if the sharpest image is in the first two images of the list + """ + sharpest_index = np.argmax(sharpnesses) sharpness_length = len(sharpnesses)