Tiled/Databroker compatibility for composite parameters - #65
Open
Bilchreis wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tiled and Databroker only support flat (non-nested) datatypes, but SECoP
allows arbitrarily nested
StructOf/TupleOfparameters. This PR addssupport for decomposing shallow composite parameters (nesting depth <= 1)
into individual flat signals so they can be consumed by tiled/databroker,
instead of failing or silently misrepresenting the data.
Composite parameter decomposition
CompositeKindclassifier (util.classify_datatype) sorts aparameter's datatype into:
ATOMIC— scalar or array-of-scalar, unchanged single-Signal behaviour.DECOMPOSABLE— a top-levelStructOf/TupleOfwith depth <= 1: splitinto one read-only
param_name_<member>SignalRper member, plus awrite-only
param_nameSignalWif the parameter is settable.UNSUPPORTED— deeper nesting (struct/tuple nested inside astruct/tuple/array): no signal is generated. Raises
IncompatibleSECoPDatatypeif the parameter is mandatory for themodule's interface class, otherwise warns and skips it.
SECoPBackendgains aMEMBERattribute type for these split signals;each fetches the parent's cached wire reading and extracts its own
field/index, so no extra round-trips are incurred.
status(SECoP'sTupleOf(EnumType, StringType)) is now alwaysdecomposed into
status_0/status_1instead of exposing a singlestructured-numpy-array signal.
SECoPMoveableDeviceis now generic over its target datatype(
StandardMovable[SignalDatatypeT]);locate(),movable_logic, andset_name()were updated to handle the case wheretarget/valuearedecomposed (write-only
target, and a private undecomposedvaluereadback signal built solely to satisfy
StandardMovable's internalplumbing).
GenNodeCode.pyupdated to codegen the split member signals, per-memberenum classes for enum-typed struct/tuple members, and the parametrized
SECoPMoveableDevice[T]base class.Other changes
limit (
warn_on_long_device_names).SECoPReadableDevice.observe_status_changeand thenow-unused
bluesky.plan_stubsimport.Tests
test_device_naming.pyfor the long-name warning.test_classgen.py,test_dtype.py,test_nested.py,test_annotation.py, andtest_Node.pyto cover composite-parameterdecomposition,
CompositeKindclassification, andset_nametiming.