From 61d029205511c200781390596a99f7602914ab09 Mon Sep 17 00:00:00 2001 From: Callum Forrester Date: Mon, 17 Jun 2024 10:56:23 +0100 Subject: [PATCH] Fix resource kwargs inconsistencies with nexus writer --- src/ophyd_async/panda/writers/_hdf_writer.py | 2 +- src/ophyd_async/panda/writers/_panda_hdf_file.py | 2 +- tests/panda/test_hdf_panda.py | 2 +- tests/panda/test_writer.py | 2 +- 4 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 63ba64e81e..64575f6638 100644 --- a/src/ophyd_async/panda/writers/_hdf_writer.py +++ b/src/ophyd_async/panda/writers/_hdf_writer.py @@ -85,7 +85,7 @@ async def _update_datasets(self) -> None: capture_table = await self.panda_device.data.datasets.get_value() self._datasets = [ - _HDFDataset(dataset_name, dataset_name, [1], multiplier=1) + _HDFDataset(dataset_name, "/" + dataset_name, [1], multiplier=1) for dataset_name in capture_table["name"] ] diff --git a/src/ophyd_async/panda/writers/_panda_hdf_file.py b/src/ophyd_async/panda/writers/_panda_hdf_file.py index e6c7fe6c72..44ec51d347 100644 --- a/src/ophyd_async/panda/writers/_panda_hdf_file.py +++ b/src/ophyd_async/panda/writers/_panda_hdf_file.py @@ -30,7 +30,7 @@ def __init__( data_key=ds.data_key, resource_path=(f"{str(directory_info.root)}/{full_file_name}"), resource_kwargs={ - "internal_path": ds.internal_path, + "path": ds.internal_path, "multiplier": ds.multiplier, "timestamps": "/entry/instrument/NDAttributes/NDArrayTimeStamp", }, diff --git a/tests/panda/test_hdf_panda.py b/tests/panda/test_hdf_panda.py index 7a44e4e2cf..5ef81b7f40 100644 --- a/tests/panda/test_hdf_panda.py +++ b/tests/panda/test_hdf_panda.py @@ -145,7 +145,7 @@ def flying_plan(): assert stream_resource["spec"] == "AD_HDF5_SWMR_SLICE" assert stream_resource["run_start"] == docs["start"][0]["uid"] assert stream_resource["resource_kwargs"] == { - "internal_path": dataset_name, + "path": "/" + dataset_name, "multiplier": 1, "timestamps": "/entry/instrument/NDAttributes/NDArrayTimeStamp", } diff --git a/tests/panda/test_writer.py b/tests/panda/test_writer.py index 14db695499..dfe0ef5c86 100644 --- a/tests/panda/test_writer.py +++ b/tests/panda/test_writer.py @@ -188,7 +188,7 @@ async def test_collect_stream_docs( "data_key": name, "resource_path": str(tmp_path / "mock_panda" / "data.h5"), "resource_kwargs": { - "internal_path": name, + "path": "/" + name, "multiplier": 1, "timestamps": "/entry/instrument/NDAttributes/NDArrayTimeStamp", },