From 8096af29487f4e632a301f4c60a76f8e010870ac Mon Sep 17 00:00:00 2001 From: Robert Tuck Date: Tue, 7 Jan 2025 16:26:22 +0000 Subject: [PATCH] Make type-checking happy --- src/dodal/common/beamlines/beamline_utils.py | 5 ++--- src/dodal/utils.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/dodal/common/beamlines/beamline_utils.py b/src/dodal/common/beamlines/beamline_utils.py index aa0eb052f7..37dfb8e1a3 100644 --- a/src/dodal/common/beamlines/beamline_utils.py +++ b/src/dodal/common/beamlines/beamline_utils.py @@ -13,7 +13,6 @@ from dodal.utils import ( AnyDevice, BeamlinePrefix, - D, DeviceInitializationController, SkipType, skip_device, @@ -141,8 +140,8 @@ def device_factory( SkipType, "mark the factory to be (conditionally) skipped when beamline is imported by external program", ] = False, -) -> Callable[[Callable[[], D]], DeviceInitializationController[D]]: - def decorator(factory: Callable[[], D]) -> DeviceInitializationController[D]: +) -> Callable[[Callable[[], T]], DeviceInitializationController[T]]: + def decorator(factory: Callable[[], T]) -> DeviceInitializationController[T]: return DeviceInitializationController( factory, use_factory_name, diff --git a/src/dodal/utils.py b/src/dodal/utils.py index 3dfc71df2c..205feaefa9 100644 --- a/src/dodal/utils.py +++ b/src/dodal/utils.py @@ -203,7 +203,7 @@ def __call__( ) else: assert is_v1_device_type(type(device)) - device.wait_for_connection(timeout=timeout) + device.wait_for_connection(timeout=timeout) # type: ignore if name: device.set_name(name)