lisa.datautils.Timestamp#
- class lisa.datautils.Timestamp(ts, unit='s', rounding='down')[source]#
Bases:
float
Nanosecond-precision timestamp. It inherits from
float
and as such can be manipulating as a floating point number of seconds. Thenanoseconds
attribute allows getting the exact timestamp regardless of the magnitude of the float, allowing for more precise computation.- Parameters:
unit (str) – Unit of the
ts
value being passed. One of"s"
,"ms"
,"us"
and"ns"
.rounding (str) – How to round the value when converting to float. Timestamps of large magnitude will suffer from the loss of least significant digits in their float value which will not have nanosecond precision. The rounding determines if a value below or above the actual nanosecond-precision timestamp should be used. One of
"up"
or"down"
.
Attributes
Methods
abs(self).
Return self//value.
Return self%value.
-self.
+self.
Return self-value.
Return self/value.
Attributes#
- Timestamp.__slots__ = ('as_nanoseconds', '_Timestamp__rounding')#