Mercurial Hosting > traffic-intelligence
changeset 1121:6baa915dd8bd
added functionalities for TemporalIndicator (for Lionel)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 08 Jul 2019 16:27:18 -0400 |
parents | 79c18dde0864 |
children | 58efbe18f102 |
files | trafficintelligence/indicators.py |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/trafficintelligence/indicators.py Tue Jul 02 14:55:29 2019 -0400 +++ b/trafficintelligence/indicators.py Mon Jul 08 16:27:18 2019 -0400 @@ -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: