From: Martin Mares Date: Sat, 8 Aug 2009 15:37:35 +0000 (+0200) Subject: A brief experiment with pipelines X-Git-Tag: python-dummy-working~94 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6eefff783e5c9e3dd393b812869e0c597c74f121;p=moe.git A brief experiment with pipelines --- 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_')