From f2b64c804e5865b816c8944d3a172baf284ab453 Mon Sep 17 00:00:00 2001 From: Tom Cobb Date: Fri, 17 May 2024 13:50:54 +0000 Subject: [PATCH] Fix enum handling in PAndA --- src/ophyd_async/panda/writers/_hdf_writer.py | 6 +++--- tests/panda/test_writer.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ophyd_async/panda/writers/_hdf_writer.py b/src/ophyd_async/panda/writers/_hdf_writer.py index 7a48bfb324..60f4a67bf8 100644 --- a/src/ophyd_async/panda/writers/_hdf_writer.py +++ b/src/ophyd_async/panda/writers/_hdf_writer.py @@ -79,10 +79,10 @@ async def get_signals_marked_for_capture( capture_signals.keys(), capture_signals.values(), signal_values ): signal_path = signal_path.replace("_capture", "") - if (signal_value.value in iter(Capture)) and (signal_value.value != Capture.No): + if (signal_value in iter(Capture)) and (signal_value != Capture.No): signals_to_capture[signal_path] = CaptureSignalWrapper( signal_object, - signal_value.value, + signal_value, ) return signals_to_capture @@ -149,7 +149,7 @@ async def open(self, multiplier: int = 1) -> Dict[str, DataKey]: else split_path[-2] ) - for suffix in str(capture_signal.capture_type).split(" "): + for suffix in capture_signal.capture_type.split(" "): self._datasets.append( _HDFDataset( name, diff --git a/tests/panda/test_writer.py b/tests/panda/test_writer.py index 99e8fb6ce2..e056648ef4 100644 --- a/tests/panda/test_writer.py +++ b/tests/panda/test_writer.py @@ -205,4 +205,4 @@ async def get_numeric_signal(_): "ophyd_async.panda.writers._hdf_writer.get_signals_marked_for_capture", get_numeric_signal, ): - assert "test-panda-block-1-Capture.Value" in await mock_writer.open() + assert "test-panda-block-1-Value" in await mock_writer.open()