changeset 724:b75d0c258ca9

update to indicator class
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 06 Aug 2015 18:00:25 -0400
parents e14e2101a5a9
children 35bc5e30a53f
files python/indicators.py
diffstat 1 files changed, 1 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/python/indicators.py	Thu Aug 06 17:47:04 2015 -0400
+++ b/python/indicators.py	Thu Aug 06 18:00:25 2015 -0400
@@ -44,10 +44,7 @@
 
     def __getitem__(self, t):
         'Returns the value at time t'
-        if t in self.values.keys():
-            return self.values[t]
-        else:
-            return None
+        return self.values.get(t)
 
     def getIthValue(self, i):
         sortedKeys = sorted(self.values.keys())
@@ -87,17 +84,6 @@
         if self.maxValue:
             ylim(ymax = self.maxValue)
 	
-    def valueSorted(self):
-	''' return the values after sort the keys in the indicator
-        This should probably not be used: to delete''' 
-        print('Deprecated: values should not be accessed in this way')
-        values=[]
-        keys = self.values.keys()
-        keys.sort()
-        for key in keys:
-            values.append(self.values[key]) 
-        return values
-
 
 def l1Distance(x, y): # lambda x,y:abs(x-y)
     if x is None or y is None: