From a1784941feadde26a6b2f8feee1b52fae8d407cc Mon Sep 17 00:00:00 2001 From: jaknapper Date: Wed, 16 Apr 2025 11:17:55 +0100 Subject: [PATCH] Ruff formatting and removing all capturing from smart_scan --- src/openflexure_microscope_server/things/z_stack.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/openflexure_microscope_server/things/z_stack.py b/src/openflexure_microscope_server/things/z_stack.py index 97cd83a7..9b1edfe6 100644 --- a/src/openflexure_microscope_server/things/z_stack.py +++ b/src/openflexure_microscope_server/things/z_stack.py @@ -1,10 +1,6 @@ import os -from typing import Mapping, Optional -import cv2 import numpy as np from PIL import Image -from pydantic import BaseModel -from scipy.stats import norm import time import piexif import json @@ -15,9 +11,7 @@ from labthings_fastapi.decorators import thing_action, thing_property from .camera import CameraDependency as CamDep from .stage import StageDependency as StageDep from labthings_fastapi.dependencies.invocation import ( - CancelHook, InvocationLogger, - InvocationCancelledError, ) @@ -87,7 +81,7 @@ class ZStackThing(Thing): capture_start = time.time() image, metadata = self._capture_image(cam, metadata_getter,) acquisition_time = time.time() - self._save_capture(jpeg_path, image, metadata) + self._save_capture(jpeg_path, image, metadata, logger) save_time = time.time() acquisition_duration = round(acquisition_time - capture_start, 1) saving_duration = round(save_time - acquisition_time, 1) @@ -114,6 +108,7 @@ class ZStackThing(Thing): jpeg_path: str, image: np.ndarray, metadata: dict, + logger: InvocationLogger, ) -> None: """Saving the captured image and metadata to disk logger warning (via InvocationLogger) is raised if metadata is failed to be added