From b2fa65ecfe14bb9377fbd8afa5f457a07472b6fb Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Mon, 11 Feb 2013 18:28:31 -0500 Subject: First attempt at plot_exps.py. --- parse/tuple_table.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'parse/tuple_table.py') diff --git a/parse/tuple_table.py b/parse/tuple_table.py index 469a424..105b786 100644 --- a/parse/tuple_table.py +++ b/parse/tuple_table.py @@ -12,7 +12,7 @@ class TupleTable(object): self.col_map = col_map self.table = defaultdict(default) - def col_map(self): + def get_col_map(self): return self.col_map def __getitem__(self, kv): @@ -93,14 +93,21 @@ class ReducedTupleTable(TupleTable): Leaf = namedtuple('Leaf', ['stat', 'variable', 'base', 'summary', 'config', 'values']) def leafs(): - for path, values in dir_map.leafs(): - stat, variable, base_type, summary_type, leaf = path + for path, node in dir_map.leafs(): + # The path will be of at least size 1: the filename + leaf = path.pop() + + # Set acceptable defaults for the rest of the path + path += ['?', '?', 'Avg', 'Avg'][len(path):] + + [stat, variable, base_type, summary_type] = path config_str = leaf[:leaf.index('.csv')] config = ColMap.decode(config_str) - yield Leaf(stat, variable, base_type, - summary_type, config, values) + leaf = Leaf(stat, variable, base_type, + summary_type, config, node.values) + yield leaf builder = ColMapBuilder() @@ -119,7 +126,6 @@ class ReducedTupleTable(TupleTable): summary = table[leaf.config][leaf.stat] summary[leaf.summary][leaf.base] = y - print("read: %s" % table) return table def write_map(self, out_map): -- cgit v1.2.2