Sort MeasurementSet by time stamp
This commit is contained in:
parent
da023273d8
commit
33439354f8
@ -27,6 +27,8 @@ class MeasurementSet(list):
|
||||
if any([not isinstance(i, Measurement) for i in mlist]):
|
||||
raise TypeError('Object in list should be of Measurement type')
|
||||
|
||||
# Sort by time stamp, otherwise the order is random
|
||||
mlist.sort(key=lambda x: x.time, reverse=True)
|
||||
super().__init__(mlist)
|
||||
|
||||
def getNewestReferenceMeasurement(self, mtype: MeasurementType):
|
||||
@ -106,4 +108,3 @@ class MeasurementSet(list):
|
||||
return all([first == meas.channelConfig for meas in self])
|
||||
else:
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user