Skip to main content

Module fixed_records

Module fixed_records 

Source
Expand description

Fixed-width values read straight out of a memory map.

A column is a run of values width bytes wide, stride bytes apart, starting start bytes into one of the reader’s sources; count values side by side make one Array cell. Rows of records (each field a column with the record size as its stride) and one file per column (stride equal to width) are both that shape, so one strided decoder serves the format specs and NumPy arrays, and decode is public for other readers of packed values (audio samples, CAN signals). The sources are kept, so a viewer of the raw bytes can read them too.

The frame is decoded over a row index (crate::row_index): a query decodes only the columns and rows it reaches, and runs on the streaming engine. A window of an untouched view is read through FixedRecords::window, which starts the columns further in and builds no index.

Structs§

ColumnLayout
One column: where its values are and how to read them.
FixedRecords
Columns of fixed-width values over one or more sources, rows long.

Enums§

Bytes
The bytes a column reads.
Logical
What a value means beyond how it is stored.
Null
A stored value that means “no value”.
Physical
How a value’s bytes are stored.

Functions§

decode
The first rows values of column from bytes: one cell a row, an Array of column.count values each when it holds more than one. Asking for more rows than bytes holds is an error.
decode_at
The values of column from bytes for records that start at records, in that order: each record’s cell is column.start bytes into it, and stride is not used. For records that are not evenly spaced, such as the messages of a log, found by an index. A cell past the end of bytes is an error.
decode_rows
The values of column from bytes for the rows index names, in that order. A missing row, or one bytes does not hold, is an error.
hex
Bytes as space-separated hex pairs.
integers
Integers as their column means them: plain at its width, or as its logical says (a datetime, a duration, a factor and offset, an enum’s labels). Public for readers that find their integers some other way, such as bit fields of CAN signals.
latin1
Text from a fixed-width ISO 8859-1 field, padding trimmed as text trims it.
read_signed
An integer of bytes.len() bytes, two’s complement.
read_unsigned
An integer of bytes.len() bytes, unsigned.
text
Text from a fixed-width field: UTF-8 where it is, padding trimmed from the right.
utf16
Text from a fixed-width UTF-16 field, NUL and space units trimmed from the right. An odd last byte and unpaired surrogates read as the replacement character.
utf32
Text from a fixed-width UTF-32 field, NUL characters trimmed from the right as NumPy trims them. A unit that is no character, and an odd last few bytes, read as the replacement character.