From 1692a32e11810159a3843f8a1408db095782e7d9 Mon Sep 17 00:00:00 2001 From: Eva Lott Date: Fri, 1 Nov 2024 15:12:04 +0000 Subject: [PATCH] stopped vectorising fields --- src/pandablocks_ioc/_pvi.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pandablocks_ioc/_pvi.py b/src/pandablocks_ioc/_pvi.py index a8a29a38..dd4db0ce 100644 --- a/src/pandablocks_ioc/_pvi.py +++ b/src/pandablocks_ioc/_pvi.py @@ -47,6 +47,7 @@ def q_group_formatter( access: str, channel: Literal["VAL", "NAME"], other_fields: dict[str, str] | None = None, + vectorize: bool = True, ) -> dict: other_fields = other_fields or {} @@ -56,9 +57,14 @@ def q_group_formatter( pvi_field = f"pvi.{panda_field_lower}.{access}" # New `value.someblock[1]` field. - stripped_name, stripped_number = _extract_number_at_end_of_string(panda_field_lower) - value_number = "" if stripped_number is None else f"[{stripped_number}]" - value_field = f"value.{stripped_name}{value_number}.{access}" + if vectorize: + stripped_name, stripped_number = _extract_number_at_end_of_string( + panda_field_lower + ) + value_number = "" if stripped_number is None else f"[{stripped_number}]" + value_field = f"value.{stripped_name}{value_number}.{access}" + else: + value_field = f"value.{panda_field_lower}.{access}" return { block_name_suffixed: { @@ -102,15 +108,10 @@ def add_pvi_info_to_record( ): block, field = record_name.split(":", maxsplit=1) pvi_pv = RecordName(f"{block}:PVI") + record.add_info( "Q:group", - { - pvi_pv: q_group_formatter( - field, - access, - "NAME", - ) - }, + {pvi_pv: q_group_formatter(field, access, "NAME", vectorize=False)}, )