Skip to content

Modify the VALID_METADATA_ARGS of BaseParameterAccessor Class #87

Description

@Ohisemega

From the PR on Odin-data: #512, we need the odin-data adapter to 'understand' the metadata response from Odin-data's C++ application. There is a mismatch between the list of metadata keys allowed and what the C++ application sends.
The BaseParameterAccessor class has a list of allowed metadata key-strings:

VALID_METADATA_ARGS = (
       "min", "max", "allowed_values", "name", "description", "units", "display_precision"
)

We need to add "access_mode" and "type" to this list, given that is what our C++ application sends.
We also need to change the line:

# Set the writeable metadata field if the setter is callable
self.metadata["writeable"] = callable(self._set)

to:

# Set the writeable metadata field if the setter is callable
self.metadata["writeable"] = callable(self.set) or self.metadata["access_mode"]

CC: @timcnicholls & @ajgdls

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions