diff trafficintelligence/indicators.py @ 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 956a66096e91
children bb14f919d1cb
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: