Ruff formatting and removing all capturing from smart_scan
This commit is contained in:
parent
603b9c7d16
commit
a1784941fe
1 changed files with 2 additions and 7 deletions
|
|
@ -1,10 +1,6 @@
|
||||||
import os
|
import os
|
||||||
from typing import Mapping, Optional
|
|
||||||
import cv2
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from pydantic import BaseModel
|
|
||||||
from scipy.stats import norm
|
|
||||||
import time
|
import time
|
||||||
import piexif
|
import piexif
|
||||||
import json
|
import json
|
||||||
|
|
@ -15,9 +11,7 @@ from labthings_fastapi.decorators import thing_action, thing_property
|
||||||
from .camera import CameraDependency as CamDep
|
from .camera import CameraDependency as CamDep
|
||||||
from .stage import StageDependency as StageDep
|
from .stage import StageDependency as StageDep
|
||||||
from labthings_fastapi.dependencies.invocation import (
|
from labthings_fastapi.dependencies.invocation import (
|
||||||
CancelHook,
|
|
||||||
InvocationLogger,
|
InvocationLogger,
|
||||||
InvocationCancelledError,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -87,7 +81,7 @@ class ZStackThing(Thing):
|
||||||
capture_start = time.time()
|
capture_start = time.time()
|
||||||
image, metadata = self._capture_image(cam, metadata_getter,)
|
image, metadata = self._capture_image(cam, metadata_getter,)
|
||||||
acquisition_time = time.time()
|
acquisition_time = time.time()
|
||||||
self._save_capture(jpeg_path, image, metadata)
|
self._save_capture(jpeg_path, image, metadata, logger)
|
||||||
save_time = time.time()
|
save_time = time.time()
|
||||||
acquisition_duration = round(acquisition_time - capture_start, 1)
|
acquisition_duration = round(acquisition_time - capture_start, 1)
|
||||||
saving_duration = round(save_time - acquisition_time, 1)
|
saving_duration = round(save_time - acquisition_time, 1)
|
||||||
|
|
@ -114,6 +108,7 @@ class ZStackThing(Thing):
|
||||||
jpeg_path: str,
|
jpeg_path: str,
|
||||||
image: np.ndarray,
|
image: np.ndarray,
|
||||||
metadata: dict,
|
metadata: dict,
|
||||||
|
logger: InvocationLogger,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Saving the captured image and metadata to disk
|
"""Saving the captured image and metadata to disk
|
||||||
logger warning (via InvocationLogger) is raised if metadata is failed to be added
|
logger warning (via InvocationLogger) is raised if metadata is failed to be added
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue