Added extra getReferemenceMeasurements() method to MeasurementSet. Bumped therefore to v1.6.0

This commit is contained in:
Anne de Jong 2024-03-19 13:39:17 +01:00
parent da023273d8
commit 3005f17400
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,7 @@ requires-python = ">=3.10"
description = "Library for Acoustic Signal Processing"
license = { "file" = "LICENSE" }
authors = [{ "name" = "J.A. de Jong", "email" = "j.a.dejong@ascee.nl" }]
version = "1.5.1"
version = "1.6.0"
keywords = ["DSP", "DAQ", "Signal processing"]

View File

@ -44,6 +44,17 @@ class MeasurementSet(list):
if mnewest.time < m.time:
mnewest = m
return mnewest
def getReferenceMeasurements(self, mtype: MeasurementType):
"""Get all reference measurements of a certain type
Args:
mtype (MeasurementType): The type of which to list
Returns:
a new measurement set including all measurements of a certain type
"""
return [m for m in self if m.measurementType() == mtype]
def getNewestReferenceMeasurements(self):
"""Returns a dictionary with newest measurement of each type that is not specific returns None in case no measurement is found."""