aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark.py')
-rw-r--r--benchmark.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/benchmark.py b/benchmark.py
index 920772f..caa25fd 100644
--- a/benchmark.py
+++ b/benchmark.py
@@ -93,15 +93,17 @@ class Benchmark (object):
return True
- def iterate_args(self):
+ def iterate_args(self, args=None):
"""Return a dict for each possible combination of args"""
- arg_names = sorted(self.args.keys())
- for p in itertools.product(*[self.args[k] for k in arg_names]):
+ if not args:
+ args = self.args
+ arg_names = sorted(args.keys())
+ for p in itertools.product(*[args[k] for k in arg_names]):
Perm = namedtuple("Perm", arg_names)
yield Perm(*p)
- def iterate_args_fixed(self, fixed):
- for p in self.iterate_args():
+ def iterate_args_fixed(self, fixed, args=None):
+ for p in self.iterate_args(args=args):
p_dict = p._asdict()
is_fixed = True
for k in fixed: