Data Schema Classes#
The following classes encode keywords comprising the schema for the DATA segment ($DATATYPE, $BYTEORD, $PnB, $PnR, $PnDATATYPE).
Only certain data schema are valid for a given FCS version, summarized below:
Data Schema |
FCS2.0 |
FCS3.0 |
FCS3.1 |
FCS3.2 |
|---|---|---|---|---|
X |
X |
|||
X |
X |
|||
X |
X |
|||
X |
X |
|||
X |
X |
|||
X |
X |
|||
X |
X |
|||
X |
||||
X |
X |
X |
X |
|
X |
X |
X |
X |
Concrete Data Schema Classes#
Ordered Numeric Data#
Data schema encoded using numeric binary types (unsigned integer or float) using any byte order. Used for FCS 2.0 and 3.0.
- class pyreflow.OrderedUintDataSchema(ranges, byte_width=4, byteord='little')#
Bases:
OrderedDataSchemaAn integer data schema with any byte order and a single width.
- Variables:
ranges (
list[IntRange]) – (read-only) The maximum value of each measurement. Corresponds to the $PnR keyword less one.byte_width (
ByteWidth) – (read-only) The width of the data schema in bytes. Must be an integer 1 to 8. All inrangesmust be able to fit within the allotted bytes. Defaults to4.byteord (
ByteOrd) – (read-only) The byte order to use when encoding values. Defaults to"little".
- Raises:
InvalidKeywordValueError – if
byteordis not"little","big", or a list of unique integers in any order
- class pyreflow.OrderedF32DataSchema(ranges, byteord='little')#
Bases:
OrderedDataSchema32-bit ordered float data schema.
- Variables:
ranges (
list[FloatRange]) – (read-only) The range for each measurement. Corresponds to $PnR. This is not used internally.byteord (
ByteOrd) – (read-only) The byte order to use when encoding values. Defaults to"little".
- Raises:
InvalidKeywordValueError – if
byteordis not"little","big", or a list of all integers from 1 to 4 in any orderInvalidKeywordValueError – if any in
rangesisNaN,inf,-inf, or outside the bounds of a 32-bit float
- byte_width#
The width of each measurement in bytes (read-only).
Will always return
4.This corresponds to the value of $PnB divided by 8, which are all equal for this data schema.
- Return type:
- class pyreflow.OrderedF64DataSchema(ranges, byteord='little')#
Bases:
OrderedDataSchema64-bit ordered float data schema.
- Variables:
ranges (
list[FloatRange]) – (read-only) The range for each measurement. Corresponds to $PnR. This is not used internally.byteord (
ByteOrd) – (read-only) The byte order to use when encoding values. Defaults to"little".
- Raises:
InvalidKeywordValueError – if
byteordis not"little","big", or a list of all integers from 1 to 8 in any orderInvalidKeywordValueError – if any in
rangesisNaN,inf,-inf, or outside the bounds of a 64-bit float
- byte_width#
The width of each measurement in bytes (read-only).
Will always return
8.This corresponds to the value of $PnB divided by 8, which are all equal for this data schema.
- Return type:
Big/Little Numeric Data#
Data schema encoded using numeric binary types (unsigned integer or float) using either big or little endian. Used for FCS 3.1 and 3.2.
Note that VariableUintDataSchema() is special in that it has
only datatype (according to the $DATATYPE keyword) but it is not considered a
matrix data schema (ie does not subclass
pyreflow.typing.MatrixDataSchema()) because its columns may be
different widths and thus may be different primitive data types (ie u16 vs
u32).
- class pyreflow.BigLittleF32DataSchema(ranges, endian='little')#
Bases:
MatrixDataSchema,BigLittleDataSchema32-bit endian float data schema
- Variables:
ranges (
list[FloatRange]) – (read-only) The range for each measurement. Corresponds to $PnR. This is not used internally.endian (
Endian) – (read-only) If"big"use big endian (4,3,2,1) for encoding values; if"little"use little endian (1,2,3,4). Defaults to"little".
- Raises:
InvalidKeywordValueError – if any in
rangesisNaN,inf,-inf, or outside the bounds of a 32-bit float
- byte_width#
The width of each measurement in bytes (read-only).
Will always return
4.This corresponds to the value of $PnB divided by 8, which are all equal for this data schema.
- Return type:
- class pyreflow.BigLittleF64DataSchema(ranges, endian='little')#
Bases:
MatrixDataSchema,BigLittleDataSchema64-bit endian float data schema
- Variables:
ranges (
list[FloatRange]) – (read-only) The range for each measurement. Corresponds to $PnR. This is not used internally.endian (
Endian) – (read-only) If"big"use big endian (4,3,2,1) for encoding values; if"little"use little endian (1,2,3,4). Defaults to"little".
- Raises:
InvalidKeywordValueError – if any in
rangesisNaN,inf,-inf, or outside the bounds of a 64-bit float
- byte_width#
The width of each measurement in bytes (read-only).
Will always return
8.This corresponds to the value of $PnB divided by 8, which are all equal for this data schema.
- Return type:
- class pyreflow.SingleUintDataSchema(ranges, byte_width=4, endian='little')#
Bases:
MatrixDataSchema,BigLittleDataSchemaA mixed-width integer data schema.
- Variables:
ranges (
list[IntRange]) – (read-only) The maximum value of each measurement. Corresponds to the $PnR keyword less one.byte_width (
ByteWidth) – (read-only) The width of the data schema in bytes. Must be an integer 1 to 8. All inrangesmust be able to fit within the allotted bytes. Defaults to4.endian (
Endian) – (read-only) If"big"use big endian (4,3,2,1) for encoding values; if"little"use little endian (1,2,3,4). Defaults to"little".
- class pyreflow.VariableUintDataSchema(ranges, endian='little')#
Bases:
BigLittleDataSchema,NumericDataSchemaA mixed-width integer data schema.
- Variables:
ranges (
list[VariableBitmask]) – (read-only) The width and range of each measurement.endian (
Endian) – (read-only) If"big"use big endian (4,3,2,1) for encoding values; if"little"use little endian (1,2,3,4). Defaults to"little".
- byte_widths#
The width of each measurement in bytes (read-only).
This corresponds to the value of $PnB for each measurement divided by 8. Values for each measurement may be different.
Mixed Data Schema#
Data schema which can include any type (character, float, unsigned integer). Only for FCS 3.2.
- class pyreflow.MixedDataSchema(typed_ranges, endian='little')#
Bases:
BigLittleDataSchemaA mixed-type data schema.
- Variables:
typed_ranges (
list[MixedRange]) – (read-only) The type and range for each measurement.endian (
Endian) – (read-only) If"big"use big endian (4,3,2,1) for encoding values; if"little"use little endian (1,2,3,4). Defaults to"little".
ASCII data schema#
Data schema encoded using ASCII characters. Available in all FCS versions.
- class pyreflow.FixedAsciiDataSchema(ranges)#
Bases:
AsciiDataSchemaA fixed-width ASCII data schema.
- Variables:
ranges (
list[IntRange]) – (read-only) The range for each measurement. Equivalent to $PnR. The value of $PnB will be derived from these and will be equivalent to the number of digits for each value.
- char_widths#
The width of each measurement (read-only).
Equivalent to $PnB, which is the number of chars/digits used to encode data for a given measurement.
- class pyreflow.DelimAsciiDataSchema(ranges)#
Bases:
AsciiDataSchemaA delimited ASCII data schema.
Abstract Superclasses#
The following classes are abstract interfaces for the concrete classes listed
above. Their primary purpose is to provide a convenient way to filter each class
by isinstance().
- class pyreflow.typing.BigLittleDataSchema#
Bases:
ABCA data schema which can be either big or little endian.
- class pyreflow.typing.SingleTypedDataSchema#
Bases:
ABCA data schema defined by a single $DATATYPE value.
- class pyreflow.typing.AsciiDataSchema#
Bases:
SingleTypedDataSchemaA data schema which uses ASCII for the underlying encoding.
- class pyreflow.typing.NumericDataSchema#
Bases:
ABCA data schema which uses binary-encoded numbers.
- class pyreflow.typing.MatrixDataSchema#
Bases:
SingleTypedDataSchema,NumericDataSchemaA data schema which has only one numeric value type.
- class pyreflow.typing.OrderedDataSchema#
Bases:
MatrixDataSchemaA data schema which can be encoded with any byte order.