From d5f35d1684422f4d0404412aac4475a4d0f68eb6 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 1 Jul 2024 14:47:23 +0100 Subject: [PATCH] change devices into eager_devices. still unsure about the lazy property --- src/blueapi/core/context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blueapi/core/context.py b/src/blueapi/core/context.py index 49207197b..e7ef98346 100644 --- a/src/blueapi/core/context.py +++ b/src/blueapi/core/context.py @@ -112,9 +112,10 @@ def with_dodal_module(self, module: ModuleType, **kwargs) -> None: devices, exceptions = make_all_devices(module, **kwargs) # for non-lazy devices, we instantiate them - early_devices = devices.items().filter(lambda x: not x.lazy) + # eager_devices = devices.items().filter(lambda x: not x.lazy) + eager_devices = {k: v for k, v in devices.items() if not v.lazy} - for device in early_devices.values(): + for device in eager_devices.values(): self.register_device(device) # If exceptions have occurred, we log them but we do not make blueapi