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]):
|
if any([not isinstance(i, Measurement) for i in mlist]):
|
||||||
raise TypeError('Object in list should be of Measurement type')
|
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)
|
super().__init__(mlist)
|
||||||
|
|
||||||
def getNewestReferenceMeasurement(self, mtype: MeasurementType):
|
def getNewestReferenceMeasurement(self, mtype: MeasurementType):
|
||||||
@ -106,4 +108,3 @@ class MeasurementSet(list):
|
|||||||
return all([first == meas.channelConfig for meas in self])
|
return all([first == meas.channelConfig for meas in self])
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user