Module pysdrlib.base.formats
Classes
class Formats (*args, **kwds)-
Expand source code
class Formats(Enum): """IO Format wrapper""" # Integer i8 = IO.i8 i16 = IO.i16 i32 = IO.i32 ui8 = IO.ui8 ui16 = IO.ui16 ui32 = IO.ui32 i4 = IO.i4 # Float f16 = IO.f16 f32 = IO.f32 f64 = IO.f64 # Complex ci8 = IO.ci8 ci16 = IO.ci16 ci32 = IO.ci32 cf32 = IO.cf32 cf64 = IO.cf64 cf128 = IO.cf128 def read(self, io, count): """Input as format""" return self.value.read(io, count) def write(self, io, data): """Output as format""" self.value.write(io, data) @property def bits(self): """Return size of format in bits""" return self.value.SIZE @property def bytes(self): """Return size of format in bytes""" return self.value.SIZE // 8 @property def is_complex(self): if issubclass(self.value, IO.ComplexFormat): return True return False @classmethod def ls(cls): return [fmt.name for fmt in cls] @classmethod def get(cls, name: str): return cls[name]IO Format wrapper
Ancestors
- enum.Enum
Class variables
var cf128var cf32var cf64var ci16var ci32var ci8var f16var f32var f64var i16var i32var i4var i8var ui16var ui32var ui8
Static methods
def get(name: str)def ls()
Instance variables
prop bits-
Expand source code
@property def bits(self): """Return size of format in bits""" return self.value.SIZEReturn size of format in bits
prop bytes-
Expand source code
@property def bytes(self): """Return size of format in bytes""" return self.value.SIZE // 8Return size of format in bytes
prop is_complex-
Expand source code
@property def is_complex(self): if issubclass(self.value, IO.ComplexFormat): return True return False
Methods
def read(self, io, count)-
Expand source code
def read(self, io, count): """Input as format""" return self.value.read(io, count)Input as format
def write(self, io, data)-
Expand source code
def write(self, io, data): """Output as format""" self.value.write(io, data)Output as format