Skip to content
Snippets Groups Projects
Commit 75fa96b8 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

fix failing rdrgen tests

parent 887ad75c
No related branches found
No related tags found
No related merge requests found
......@@ -49,10 +49,9 @@ class _Ptr(object):
def __lt__(self, that):
return (self.stamp, self.apid) < (that.stamp, that.apid)
# WTF?
# instances with same timecode/apid/size will compare the same
# def __hash__(self):
# return hash((self.stamp, self.apid, self.size))
# hash by stamp, apid, size so we can dedup in index using set
def __hash__(self):
return hash((self.stamp, self.apid, self.size))
def bytes(self):
self.fobj.seek(self.offset, os.SEEK_SET)
......
......@@ -30,7 +30,9 @@ def timecode_parts_to_iet(days, ms, us, epoch):
Convert components to a IET based on arbitrary epoch.
"""
return int(_grain.utc2tai(
epoch + timedelta(days=days, milliseconds=ms, microseconds=us),
epoch + timedelta(days=float(days),
milliseconds=float(ms),
microseconds=float(us)),
epoch) * 1e6)
......@@ -56,4 +58,5 @@ def dt_to_cds(dt):
return (d.days, int(d.seconds * 1e3), d.microseconds)
dt_to_iet = _grain.utc2iet
iet_to_dt = _grain.iet2utc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment