From bae4b2e14e7e4bb264f4e52b49a884a136a0c8a3 Mon Sep 17 00:00:00 2001 From: Dieter Weber Date: Tue, 22 Oct 2024 17:47:59 +0200 Subject: [PATCH] Make sure it works without support in LiberTEM --- src/libertem_live/udf/monitor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libertem_live/udf/monitor.py b/src/libertem_live/udf/monitor.py index 89b7256b..86ec3f26 100644 --- a/src/libertem_live/udf/monitor.py +++ b/src/libertem_live/udf/monitor.py @@ -17,13 +17,15 @@ class SignalMonitorUDF(UDF): def get_backends(self): '' + # feature detection until we depend on a version with + # https://github.com/LiberTEM/LiberTEM/pull/1684 + scipy_coo_array = getattr(self, 'BACKEND_SCIPY_COO_ARRAY', None) return [ backend for backend in self.BACKEND_ALL if backend not in { self.BACKEND_CUPY_SCIPY_COO, self.BACKEND_SCIPY_COO, - self.BACKEND_SCIPY_COO_ARRAY - } + }.union((scipy_coo_array, ) if scipy_coo_array is not None else tuple()) ] # def get_preferred_input_dtype(self):