strands-project/strands_qsr_lib

[qsrlib_io] World_QSR_Trace.get_sorted_timestamps method does not look right

Closed this issue · 3 comments

World_QSR_Trace.get_sorted_timestamps method does not look right.

Something like:

def get_sorted_timestamps(self):
        return sorted(self.trace.keys(), key=lambda x: int(x))

maybe?

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())

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.