Autofix import order
This commit is contained in:
parent
98cdb276d8
commit
7bc4c514a6
59 changed files with 244 additions and 236 deletions
|
|
@ -7,22 +7,22 @@ of images (a 'z-stack').
|
|||
See repository root for licensing information.
|
||||
"""
|
||||
|
||||
from contextlib import contextmanager
|
||||
import logging
|
||||
import time
|
||||
from typing import Annotated, Mapping, Optional, Sequence, Literal
|
||||
import os
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import dataclass
|
||||
from typing import Annotated, Literal, Mapping, Optional, Sequence
|
||||
|
||||
from fastapi import Depends
|
||||
import numpy as np
|
||||
from pydantic import BaseModel, field_validator, computed_field, model_validator
|
||||
from fastapi import Depends
|
||||
from pydantic import BaseModel, computed_field, field_validator, model_validator
|
||||
|
||||
import labthings_fastapi as lt
|
||||
from labthings_fastapi.types.numpy import NDArray
|
||||
|
||||
from .camera import RawCameraDependency as RawCamera
|
||||
from .camera import CameraDependency as CameraClient
|
||||
from .camera import RawCameraDependency as RawCamera
|
||||
from .stage import StageDependency as Stage
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -7,31 +7,32 @@ See repository root for licensing information.
|
|||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Literal, Optional, Tuple, Any, Mapping
|
||||
from types import TracebackType
|
||||
import json
|
||||
|
||||
import io
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
from datetime import datetime
|
||||
import tempfile
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
from datetime import datetime
|
||||
from types import TracebackType
|
||||
from typing import Any, Literal, Mapping, Optional, Tuple
|
||||
|
||||
import numpy as np
|
||||
from pydantic import RootModel
|
||||
from PIL import Image
|
||||
import piexif
|
||||
from PIL import Image
|
||||
from pydantic import RootModel
|
||||
|
||||
import labthings_fastapi as lt
|
||||
from labthings_fastapi.types.numpy import NDArray
|
||||
|
||||
from openflexure_microscope_server.ui import ActionButton, PropertyControl
|
||||
from openflexure_microscope_server.background_detect import (
|
||||
ColourChannelDetectLUV,
|
||||
ChannelDeviationLUV,
|
||||
BackgroundDetectAlgorithm,
|
||||
BackgroundDetectorStatus,
|
||||
ChannelDeviationLUV,
|
||||
ColourChannelDetectLUV,
|
||||
)
|
||||
from openflexure_microscope_server.ui import ActionButton, PropertyControl
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ See repository root for licensing information.
|
|||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Literal, Optional
|
||||
from types import TracebackType
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Literal, Optional
|
||||
|
||||
import cv2
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -15,39 +15,40 @@ https://datasheets.raspberrypi.com/camera/raspberry-pi-camera-guide.pdf
|
|||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Annotated, Iterator, Literal, Mapping, Optional, Any
|
||||
from types import TracebackType
|
||||
|
||||
import copy
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import copy
|
||||
import tempfile
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
from threading import RLock
|
||||
from types import TracebackType
|
||||
from typing import Annotated, Any, Iterator, Literal, Mapping, Optional
|
||||
|
||||
from pydantic import BaseModel, BeforeValidator
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
from picamera2 import Picamera2
|
||||
from picamera2.encoders import MJPEGEncoder
|
||||
from picamera2.outputs import Output
|
||||
from PIL import Image
|
||||
from pydantic import BaseModel, BeforeValidator
|
||||
|
||||
import labthings_fastapi as lt
|
||||
from labthings_fastapi.exceptions import NotConnectedToServerError
|
||||
|
||||
from openflexure_microscope_server.background_detect import ChannelBlankError
|
||||
from openflexure_microscope_server.ui import (
|
||||
ActionButton,
|
||||
PropertyControl,
|
||||
action_button_for,
|
||||
property_control_for,
|
||||
)
|
||||
from openflexure_microscope_server.background_detect import ChannelBlankError
|
||||
|
||||
from . import ArrayModel, BaseCamera
|
||||
from . import picamera_recalibrate_utils as recalibrate_utils
|
||||
from . import picamera_tuning_file_utils as tf_utils
|
||||
|
||||
from . import BaseCamera, ArrayModel
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORTED_CAMS_SENSOR_INFO = {
|
||||
|
|
|
|||
|
|
@ -41,16 +41,17 @@ reliable. The three steps above can be accomplished by:
|
|||
# ruff: noqa: N806 N803
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import gc
|
||||
import logging
|
||||
import time
|
||||
from typing import List, Tuple
|
||||
from pydantic import BaseModel
|
||||
import numpy as np
|
||||
from scipy.ndimage import zoom
|
||||
|
||||
from picamera2 import Picamera2
|
||||
import numpy as np
|
||||
import picamera2
|
||||
from picamera2 import Picamera2
|
||||
from pydantic import BaseModel
|
||||
from scipy.ndimage import zoom
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@
|
|||
The functions that edit the tuning files return a new dictionary that is updated.
|
||||
"""
|
||||
|
||||
from typing import Any, Optional
|
||||
from copy import deepcopy
|
||||
import os
|
||||
import json
|
||||
import os
|
||||
from copy import deepcopy
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
import numpy as np
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@ See repository root for licensing information.
|
|||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
import logging
|
||||
from typing import Literal, Optional, Mapping
|
||||
from types import TracebackType
|
||||
from threading import Thread
|
||||
import time
|
||||
|
||||
import io
|
||||
import logging
|
||||
import time
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Literal, Mapping, Optional
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image, ImageFilter
|
||||
|
|
@ -26,8 +27,8 @@ from openflexure_microscope_server.ui import (
|
|||
property_control_for,
|
||||
)
|
||||
|
||||
from . import BaseCamera, ArrayModel
|
||||
from ..stage import BaseStage
|
||||
from . import ArrayModel, BaseCamera
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,23 +15,23 @@ from typing import (
|
|||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Mapping,
|
||||
NamedTuple,
|
||||
Optional,
|
||||
Tuple,
|
||||
Mapping,
|
||||
)
|
||||
from fastapi import HTTPException
|
||||
|
||||
import numpy as np
|
||||
from fastapi import HTTPException
|
||||
|
||||
import labthings_fastapi as lt
|
||||
from camera_stage_mapping.camera_stage_calibration_1d import (
|
||||
calibrate_backlash_1d,
|
||||
image_to_stage_displacement_from_1d,
|
||||
)
|
||||
from camera_stage_mapping.exceptions import MappingError
|
||||
|
||||
import labthings_fastapi as lt
|
||||
from labthings_fastapi.types.numpy import DenumpifyingDict
|
||||
from camera_stage_mapping.camera_stage_tracker import Tracker
|
||||
from camera_stage_mapping.exceptions import MappingError
|
||||
from labthings_fastapi.types.numpy import DenumpifyingDict
|
||||
|
||||
from .camera import CameraDependency as CameraClient
|
||||
from .stage import StageDependency as Stage
|
||||
|
|
|
|||
|
|
@ -7,37 +7,35 @@ It also controls external processes for live stitching composite images, and
|
|||
the creation of the final stitched images.
|
||||
"""
|
||||
|
||||
from typing import (
|
||||
Optional,
|
||||
Self,
|
||||
TypeVar,
|
||||
ParamSpec,
|
||||
Callable,
|
||||
Concatenate,
|
||||
Mapping,
|
||||
Any,
|
||||
)
|
||||
import threading
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
from datetime import datetime
|
||||
from subprocess import SubprocessError
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Concatenate,
|
||||
Mapping,
|
||||
Optional,
|
||||
ParamSpec,
|
||||
Self,
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
import numpy as np
|
||||
from fastapi import HTTPException
|
||||
from fastapi.responses import FileResponse
|
||||
import numpy as np
|
||||
from pydantic import BaseModel
|
||||
|
||||
import labthings_fastapi as lt
|
||||
|
||||
from openflexure_microscope_server import scan_directories
|
||||
from openflexure_microscope_server import scan_planners
|
||||
from openflexure_microscope_server import stitching
|
||||
from openflexure_microscope_server import scan_directories, scan_planners, stitching
|
||||
|
||||
# Things
|
||||
from .autofocus import AutofocusThing, StackParams
|
||||
from .camera_stage_mapping import CameraStageMapper
|
||||
from .camera import CameraDependency as CameraClient
|
||||
from .camera_stage_mapping import CameraStageMapper
|
||||
from .stage import StageDependency as StageDep
|
||||
|
||||
T = TypeVar("T")
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ As the object will be used as a context manager create the hardware connection i
|
|||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from collections.abc import Sequence, Mapping
|
||||
from typing import Literal, Never, Any
|
||||
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Any, Literal, Never
|
||||
|
||||
import labthings_fastapi as lt
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional, Any
|
||||
from types import TracebackType
|
||||
from collections.abc import Mapping
|
||||
import time
|
||||
from collections.abc import Mapping
|
||||
from types import TracebackType
|
||||
from typing import Any, Optional
|
||||
|
||||
import labthings_fastapi as lt
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
"""Provide a LabThings-FastAPI interface to the Sangaboard motor controller."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
from copy import copy
|
||||
from typing import Iterator, Literal, Optional, Any
|
||||
from types import TracebackType
|
||||
from contextlib import contextmanager
|
||||
from collections.abc import Mapping
|
||||
from contextlib import contextmanager
|
||||
from copy import copy
|
||||
from types import TracebackType
|
||||
from typing import Any, Iterator, Literal, Optional
|
||||
|
||||
import semver
|
||||
import sangaboard
|
||||
|
||||
import labthings_fastapi as lt
|
||||
import sangaboard
|
||||
|
||||
from . import BaseStage
|
||||
|
||||
|
|
|
|||
|
|
@ -13,20 +13,20 @@ is tracked and an error is raised if it exceeds a minimum amount. Currently
|
|||
this is 10% of the expected motion is the measured axis.
|
||||
"""
|
||||
|
||||
from typing import Literal, Any, Optional, overload
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from threading import Lock
|
||||
from typing import Any, Literal, Optional, overload
|
||||
|
||||
import numpy as np
|
||||
|
||||
from camera_stage_mapping import fft_image_tracking
|
||||
import labthings_fastapi as lt
|
||||
from camera_stage_mapping import fft_image_tracking
|
||||
|
||||
# Things
|
||||
from .autofocus import AutofocusThing
|
||||
from .camera_stage_mapping import CameraStageMapper
|
||||
from .camera import CameraDependency as CamDep
|
||||
from .camera_stage_mapping import CameraStageMapper
|
||||
from .stage import StageDependency as StageDep
|
||||
|
||||
CSMDep = lt.deps.direct_thing_client_dependency(
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ A module to control the underlying microscope system and to expose information a
|
|||
the microscope, server, and thing states to the web API.
|
||||
"""
|
||||
|
||||
from collections.abc import Mapping
|
||||
import socket
|
||||
from typing import Optional, Any
|
||||
from uuid import UUID, uuid4
|
||||
import subprocess
|
||||
import os
|
||||
from signal import SIGTERM
|
||||
import socket
|
||||
import subprocess
|
||||
import time
|
||||
from collections.abc import Mapping
|
||||
from signal import SIGTERM
|
||||
from typing import Any, Optional
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue