Mercurial Hosting > traffic-intelligence
diff trafficintelligence/indicators.py @ 1125:b358bed29ab4
updates and bugs
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 30 Jan 2020 10:17:07 -0500 |
parents | 956a66096e91 |
children | bb14f919d1cb |
line wrap: on
line diff
--- a/trafficintelligence/indicators.py Tue Jun 25 17:23:43 2019 -0400 +++ b/trafficintelligence/indicators.py Thu Jan 30 10:17:07 2020 -0500 @@ -74,8 +74,15 @@ def getName(self): return self.name - def getValues(self): - return [self.__getitem__(t) for t in self.timeInterval] + def getValues(self, withNone = True): + result = [self.__getitem__(t) for t in self.timeInterval] + if withNone: + return result + else: + return [x for x in result if x is not None] + + def getInstants(self): + return list(self.values.keys()) def plot(self, options = '', xfactor = 1., yfactor = 1., timeShift = 0, **kwargs): if self.getTimeInterval().length() == 1: