secop_ophyd.datatypes.composite#
Classification of struct/tuple datatypes.
Module Contents#
Classes#
Classification of a SECoP datatype for parameter-signal construction. |
Functions#
Classify a raw SECoP datatype for parameter-signal construction. |
|
Return (member_key, member_datatype) pairs for a StructOf/TupleOf, in declaration order. |
|
Names of the optional members of a struct, from its SECoP datainfo: without an ‘optional’ entry every member is mandatory. (frappy’s StructOf cannot tell: built from such a datainfo it treats every member as optional.) |
Data#
API#
- exception secop_ophyd.datatypes.composite.IncompatibleSECoPDatatype[source]#
Bases:
ExceptionThe datatype cannot be represented as ophyd-async Signal(s): it is a struct/tuple nested inside another struct/tuple/array, which is unsupported. Raised when this happens for a parameter that is mandatory for its module’s interface class.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- secop_ophyd.datatypes.composite.MAX_DEPTH = 1#
- class secop_ophyd.datatypes.composite.CompositeKind(*args, **kwds)[source]#
Bases:
enum.EnumClassification of a SECoP datatype for parameter-signal construction.
- ATOMIC: scalar or array-of-scalar (incl. array-of-enum/blob/…) – gets
a single Signal, unchanged from today’s behaviour.
- DECOMPOSABLE: a top-level StructOf/TupleOf whose members are all
themselves ATOMIC (nesting depth <= MAX_DEPTH) – gets split into one read-only Signal per member (see get_composite_members()).
- UNSUPPORTED: an ArrayOf wrapping a StructOf/TupleOf, or a StructOf/TupleOf
containing a nested StructOf/TupleOf member – cannot be represented as flat Signals; no Signal is constructed for it.
Initialization
- ATOMIC = 'atomic'#
- DECOMPOSABLE = 'decomposable'#
- UNSUPPORTED = 'unsupported'#
- secop_ophyd.datatypes.composite.classify_datatype(datatype: frappy.datatypes.DataType) secop_ophyd.datatypes.composite.CompositeKind[source]#
Classify a raw SECoP datatype for parameter-signal construction.
- secop_ophyd.datatypes.composite.get_composite_members(datatype: frappy.datatypes.StructOf | frappy.datatypes.TupleOf) list[tuple[str, frappy.datatypes.DataType]][source]#
Return (member_key, member_datatype) pairs for a StructOf/TupleOf, in declaration order.
Struct members keep their SECoP member name as key. Tuple members are keyed by their stringified 0-based index (“0”, “1”, …), used as the _<idx> naming postfix for split signals.
- secop_ophyd.datatypes.composite.optional_struct_members(datainfo: dict) list[str][source]#
Names of the optional members of a struct, from its SECoP datainfo: without an ‘optional’ entry every member is mandatory. (frappy’s StructOf cannot tell: built from such a datainfo it treats every member as optional.)