We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3f1dc6 commit 33ffd3aCopy full SHA for 33ffd3a
src/dodal/utils.py
@@ -11,7 +11,7 @@
11
from importlib import import_module
12
from inspect import signature
13
from os import environ
14
-from types import ModuleType
+from types import FunctionType, ModuleType
15
from typing import (
16
Any,
17
Generic,
@@ -413,7 +413,9 @@ def is_v2_device_factory(func: Callable) -> TypeGuard[V2DeviceFactory]:
413
414
415
def is_any_device_factory(func: Callable) -> TypeGuard[AnyDeviceFactory]:
416
- return is_v1_device_factory(func) or is_v2_device_factory(func)
+ return isinstance(func, (FunctionType, DeviceInitializationController)) and (
417
+ is_v1_device_factory(func) or is_v2_device_factory(func)
418
+ )
419
420
421
def is_v2_device_type(obj: type[Any]) -> bool:
0 commit comments