From 6eefff783e5c9e3dd393b812869e0c597c74f121 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 8 Aug 2009 17:37:35 +0200 Subject: [PATCH] A brief experiment with pipelines --- t/moe/eval.py | 11 +++++++++++ t/test.py | 13 ++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 t/moe/eval.py diff --git a/t/moe/eval.py b/t/moe/eval.py new file mode 100644 index 0000000..9ffc4f8 --- /dev/null +++ b/t/moe/eval.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import moe.config + +def init_pipeline(cfg, prefix): + pipe = {} + for k in cfg.keys(): + if k.startswith(prefix): + pri = int(k[len(prefix):]) + pipe[pri] = cfg[k] + return [ pipe[k] for k in sorted(pipe.keys()) ] diff --git a/t/test.py b/t/test.py index d503b7c..1740395 100755 --- a/t/test.py +++ b/t/test.py @@ -5,6 +5,7 @@ sys.path.append('.') import moe.meta import moe.config +import moe.eval #m = moe.meta.MoeMeta() #m['a'] = '1' @@ -13,17 +14,19 @@ import moe.config c = moe.config.MoeConfig(name='/dev/stdin') c.dump() -d = moe.config.MoeConfig(name='/dev/stdin') -d.dump() +#d = moe.config.MoeConfig(name='/dev/stdin') +#d.dump() s = moe.config.MoeConfigStack() s.push(c) -s.push(d) +#s.push(d) s.dump_defs() -s.apply_overrides("x_") -s.dump_defs() +#s.apply_overrides("x_") +#s.dump_defs() print "***" s.dump() + +print moe.eval.init_pipeline(s, 'stk_') -- 2.39.5