deviceaccess.DataDescriptor

class deviceaccess.DataDescriptor

Bases: pybind11_object

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: deviceaccess.DataDescriptor, arg0: deviceaccess.DataDescriptor) -> None

  2. __init__(self: deviceaccess.DataDescriptor, type: deviceaccess.DataType) -> None

Construct a DataDescriptor from a DataType object.

The DataDescriptor will describe the passed DataType with no raw type.

Args:

type (DataType): The data type to describe.

  1. __init__(self: deviceaccess.DataDescriptor) -> None

Default constructor.

Initializes the DataDescriptor with fundamental type set to “undefined”.

Methods

__init__(*args, **kwargs)

Overloaded function.

fundamentalType(self)

Get the fundamental data type.

isIntegral(self)

Return whether the data is integral or not.

isSigned(self)

Return whether the data is signed or not.

minimumDataType(self)

Get the minimum data type required to represent the described data type.

nDigits(self)

Return the approximate maximum number of digits needed to represent the value.

nFractionalDigits(self)

Return the approximate maximum number of digits after the decimal dot.

rawDataType(self)

Get the raw data type.

setRawDataType(self, rawDataType)

Set the raw data type.

transportLayerDataType(self)

Get the data type on the transport layer.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: deviceaccess.DataDescriptor, arg0: deviceaccess.DataDescriptor) -> None

  2. __init__(self: deviceaccess.DataDescriptor, type: deviceaccess.DataType) -> None

Construct a DataDescriptor from a DataType object.

The DataDescriptor will describe the passed DataType with no raw type.

Args:

type (DataType): The data type to describe.

  1. __init__(self: deviceaccess.DataDescriptor) -> None

Default constructor.

Initializes the DataDescriptor with fundamental type set to “undefined”.

fundamentalType(self: deviceaccess.DataDescriptor) ChimeraTK::DataDescriptor::FundamentalType

Get the fundamental data type.

Returns:

FundamentalType: The fundamental data type.

isIntegral(self: deviceaccess.DataDescriptor) bool

Return whether the data is integral or not.

May only be called for numeric data types. Examples: int or float.

Returns:

bool: True if the data is integral, false otherwise.

isSigned(self: deviceaccess.DataDescriptor) bool

Return whether the data is signed or not.

Only valid for numeric data types.

Returns:

bool: True if the data is signed, false otherwise.

minimumDataType(self: deviceaccess.DataDescriptor) deviceaccess.DataType

Get the minimum data type required to represent the described data type.

This is the minimum data type needed in the host CPU to represent the value.

Returns:

DataType: The minimum required data type.

nDigits(self: deviceaccess.DataDescriptor) int

Return the approximate maximum number of digits needed to represent the value.

This includes a decimal dot (if not an integral data type) and the sign. May only be called for numeric data types.

Note: This number should only be used for displaying purposes. For some data types this might be a large number (e.g. 300), which indicates that a different representation than plain decimal numbers should be chosen.

Returns:

int: Approximate maximum number of digits (base 10).

nFractionalDigits(self: deviceaccess.DataDescriptor) int

Return the approximate maximum number of digits after the decimal dot.

This is expressed in base 10 and excludes the decimal dot itself. May only be called for non-integral numeric data types.

Note: This number should only be used for displaying purposes. There is no guarantee that the full precision can be displayed with the given number of digits.

Returns:

int: Approximate maximum number of fractional digits (base 10).

rawDataType(self: deviceaccess.DataDescriptor) deviceaccess.DataType

Get the raw data type.

This describes the data conversion from ‘cooked’ to raw data type on the device. The conversion does not change the shape of the data but describes the data type of a single data point.

Most backends will have type ‘none’ (no raw data conversion available).

Returns:

DataType: The raw data type.

setRawDataType(self: deviceaccess.DataDescriptor, rawDataType: deviceaccess.DataType) None

Set the raw data type.

This is useful e.g. when a decorated register should no longer allow raw access, in which case you should set DataType.none.

Args:

rawDataType (DataType): The raw data type to set.

transportLayerDataType(self: deviceaccess.DataDescriptor) deviceaccess.DataType

Get the data type on the transport layer.

This is always a 1D array of the specific data type. The raw transfer might contain data for more than one register.

Examples:
  • The multiplexed data of a 2D array

  • A text string containing data for multiple scalars mapped to different registers

  • The byte sequence of a “struct” with data for multiple registers of different types

Note: Currently all implementations return ‘none’. There is no public API to access the transport layer data yet.

Returns:

DataType: The transport layer data type.