From 89e9b3506c5244ffe1171bad397caf44356617db Mon Sep 17 00:00:00 2001 From: Dieter Weber Date: Tue, 22 Oct 2024 16:57:09 +0200 Subject: [PATCH] Support for SciPy sparse arrays See also https://github.com/LiberTEM/LiberTEM/pull/1684 Probably one will have to do a two-step rollout, first making the constants available and then incluing them in BACKEND_ALL? --- src/libertem_live/udf/monitor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libertem_live/udf/monitor.py b/src/libertem_live/udf/monitor.py index 82c4bc17..89b7256b 100644 --- a/src/libertem_live/udf/monitor.py +++ b/src/libertem_live/udf/monitor.py @@ -19,7 +19,11 @@ def get_backends(self): '' return [ backend for backend in self.BACKEND_ALL - if backend not in {self.BACKEND_CUPY_SCIPY_COO, self.BACKEND_SCIPY_COO} + if backend not in { + self.BACKEND_CUPY_SCIPY_COO, + self.BACKEND_SCIPY_COO, + self.BACKEND_SCIPY_COO_ARRAY + } ] # def get_preferred_input_dtype(self): @@ -36,7 +40,7 @@ def process_tile(self, tile): '' # Assign the portion from the last frame within the tile # to the result buffer - self.results.intensity[:] = self.forbuf(tile[-1], self.results.intensity) + self.results.intensity[:] = self.forbuf(tile[[-1]], self.results.intensity) def merge(self, dest, src): ''