[qsrlib_io] World_QSR_Trace.get_sorted_timestamps method does not look right
Closed this issue · 3 comments
gatsoulis commented
World_QSR_Trace.get_sorted_timestamps
method does not look right.
cdondrup commented
Something like:
def get_sorted_timestamps(self):
return sorted(self.trace.keys(), key=lambda x: int(x))
maybe?
gatsoulis commented
What if they are float timestamps?
Basically one more thing to deprecate and enforce to one standard that timestamps can be only numeric; leaving the get_sorted_timestamps as a wrap method to simply:
def get_sorted_timestamps(self):
return sorted(self.trace.keys())
cdondrup commented
Can also just do:
def get_sorted_timestamps(self):
return sorted(self.trace.keys(), key=lambda x: float(x))
which works for both ;)
But I agree, if the conversion is not necessary, get rid of it.