Skip to content

Commit

Permalink
MetricValues copes with differing iteration lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgibb committed Apr 9, 2012
1 parent 741bba8 commit 18b54af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions graphing/metric_values.py
Expand Up @@ -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.