Skip to content

Conversation

KaiAsaoka
Copy link

When initialising NTTable, it is assumed that the dict will only contain entries values and labels. NTTable is also unwrapped as an ordered dictionary, preventing its raw value from being accessed with commands such as pv.current().raw.get(...). This PR aims to make the NTTable implementation consistent with NTScalar and NTEnum (#154) by allowing NTTable to be initialised with other fields, and altering unwrap behaviour to return an ntwrappercommon object like NTScalar.

pv = SharedPV(
    nt=NTTable(columns=[('idx', 'i'), ('units', 'd'), ('temperature', 'd')], display=True),
    initial={
        'display.description': "Table of values for instrument temperature curve."
        'value': [{'idx': x, 'units': 0, 'temperature': 0} for x in range(1, 201)],
    }
)

Copy link
Member

@mdavidsaver mdavidsaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a reasonable addition overall. Please make the logging change.

@KaiAsaoka KaiAsaoka requested a review from mdavidsaver August 14, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants