Permalink
Browse files

MetricValues copes with differing iteration lengths

  • Loading branch information...
1 parent 741bba8 commit 18b54af6aff7a2b546cdc94c9bddbffbdc160c9c @mattgibb committed Apr 9, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 graphing/metric_values.py
@@ -4,12 +4,11 @@
class MetricValues:
def __init__(self, transform_dir):
- value_list = [genfromtxt(join(transform_dir, file)) for file in listdir(transform_dir)]
- self._values = array(value_list)
+ self._values = [genfromtxt(join(transform_dir, file)) for file in listdir(transform_dir)]
def values(self):
return self._values
def delta_values(self):
# subtract the previous value from each value
- return self._values[:,1:] - self._values[:,:-1]
+ return [row[1:] - row[:-1] for row in self._values]

0 comments on commit 18b54af

Please sign in to comment.