Merge branch 'do-not-overwrite-globals' into 'v3'
Remove the overwriting of internal globals, requires removing future annoations Closes #347 See merge request openflexure/openflexure-microscope-server!303
This commit is contained in:
commit
16dfe9073f
1 changed files with 7 additions and 10 deletions
|
|
@ -6,7 +6,6 @@ camera together to perform an autofocus routine.
|
||||||
See repository root for licensing information.
|
See repository root for licensing information.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
@ -37,9 +36,14 @@ CaptureDep = direct_thing_client_dependency(CaptureThing, "/capture/")
|
||||||
SETTLING_TIME = 0.3
|
SETTLING_TIME = 0.3
|
||||||
|
|
||||||
|
|
||||||
class JPEGSharpnessMonitor:
|
class SharpnessDataArrays(BaseModel):
|
||||||
__globals__ = globals() # Required for FastAPI dependency
|
jpeg_times: NDArray
|
||||||
|
jpeg_sizes: NDArray
|
||||||
|
stage_times: NDArray
|
||||||
|
stage_positions: list[dict[str, int]]
|
||||||
|
|
||||||
|
|
||||||
|
class JPEGSharpnessMonitor:
|
||||||
def __init__(self, stage: Stage, camera: Camera, portal: BlockingPortal):
|
def __init__(self, stage: Stage, camera: Camera, portal: BlockingPortal):
|
||||||
self.camera = camera
|
self.camera = camera
|
||||||
self.stage = stage
|
self.stage = stage
|
||||||
|
|
@ -140,13 +144,6 @@ class JPEGSharpnessMonitor:
|
||||||
SharpnessMonitorDep = Annotated[JPEGSharpnessMonitor, Depends()]
|
SharpnessMonitorDep = Annotated[JPEGSharpnessMonitor, Depends()]
|
||||||
|
|
||||||
|
|
||||||
class SharpnessDataArrays(BaseModel):
|
|
||||||
jpeg_times: NDArray
|
|
||||||
jpeg_sizes: NDArray
|
|
||||||
stage_times: NDArray
|
|
||||||
stage_positions: list[dict[str, int]]
|
|
||||||
|
|
||||||
|
|
||||||
class AutofocusThing(Thing):
|
class AutofocusThing(Thing):
|
||||||
"""The Thing concerned with combinations of z axis movements and the camera.
|
"""The Thing concerned with combinations of z axis movements and the camera.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue