Model
The Model class define a data type for use with a Block.
- class pyrogue.Model(*args, **kwargs)[source]
Class which describes how a data type is represented and accessed using the Rogue Variables and Blocks
- Parameters:
- Variables:
name (str) – String representation of the Model type
fstring (str) – Not sure what this is, Where is it used?
encoding (str) – Encoding type for converting between string and byte arrays. i.e. UTF-8
pytype (int) – Python type class.
defaultdisp (str) – Default display formatting string. May be overriden by the Variable disp parameter.
signed (bool) – Flag indicating if value is signed. Default=False
endianness (str) – Endianness indicator. ‘little’ or ‘big’. Default=’little’
bitReverse (bool) – Bit reversal flag.
modelId (int) – Block processing ID. See interfaces_memory_constants_ptype
isBigEndian (bool) – True if endianness = ‘big’
ndType (np.dtype) – numpy type value (bool, int32, int64, uint32, uin64, float32, float64)
- toBytes(value)[source]
Convert the python value to byte array.
- Parameters:
value (obj) – Python value to convert
- fromBytes(ba)[source]
Convert the python value to byte array.
- Parameters:
ba (bytearray) – Byte array to extract value from
Standard Models
The following are pre-defined models for various data types.