]> mj.ucw.cz Git - moe.git/commitdiff
A brief experiment with pipelines
authorMartin Mares <mj@ucw.cz>
Sat, 8 Aug 2009 15:37:35 +0000 (17:37 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 8 Aug 2009 15:37:35 +0000 (17:37 +0200)
t/moe/eval.py [new file with mode: 0644]
t/test.py

diff --git a/t/moe/eval.py b/t/moe/eval.py
new file mode 100644 (file)
index 0000000..9ffc4f8
--- /dev/null
@@ -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()) ]
index d503b7c0c221b68cfbd59086fefda6914926f4d3..17403958e76dac023be73c2d407b540243327562 100755 (executable)
--- 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_')