Mercurial > hg > nsaunier > traffic-intelligence
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1120:79c18dde0864 | 1121:6baa915dd8bd |
|---|---|
| 72 return self.timeInterval | 72 return self.timeInterval |
| 73 | 73 |
| 74 def getName(self): | 74 def getName(self): |
| 75 return self.name | 75 return self.name |
| 76 | 76 |
| 77 def getValues(self): | 77 def getValues(self, withNone = True): |
| 78 return [self.__getitem__(t) for t in self.timeInterval] | 78 result = [self.__getitem__(t) for t in self.timeInterval] |
| 79 if withNone: | |
| 80 return result | |
| 81 else: | |
| 82 return [x for x in result if x is not None] | |
| 83 | |
| 84 def getInstants(self): | |
| 85 return list(self.values.keys()) | |
| 79 | 86 |
| 80 def plot(self, options = '', xfactor = 1., yfactor = 1., timeShift = 0, **kwargs): | 87 def plot(self, options = '', xfactor = 1., yfactor = 1., timeShift = 0, **kwargs): |
| 81 if self.getTimeInterval().length() == 1: | 88 if self.getTimeInterval().length() == 1: |
| 82 marker = 'o' | 89 marker = 'o' |
| 83 else: | 90 else: |
