aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/base
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-12-30 14:08:15 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-01-03 18:16:12 +0800
commitd8c05b528b5a75377848d130286bc997da06a792 (patch)
treed88f44e3a0d87ffdf64ba20ecf0417e01f63427f /qtip/base
parentdecad5f7fdb212c4f78fc31f00e591eaba104450 (diff)
Implement plan, qpi and metric constructors
- separate runner from `plan` and move `plan` to `loader` - rename `algorithm` to `formula` - use `numpy` for formulas - update sample qpi and metrics Change-Id: I3131ca79907376f2de31d6cb920bd7d0230664a6 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/base')
-rw-r--r--qtip/base/constant.py6
-rw-r--r--qtip/base/error.py13
2 files changed, 16 insertions, 3 deletions
diff --git a/qtip/base/constant.py b/qtip/base/constant.py
index 187f0706..76481b47 100644
--- a/qtip/base/constant.py
+++ b/qtip/base/constant.py
@@ -8,8 +8,8 @@
##############################################################################
-class AlgoName(object):
- """algorithm names"""
+class FormulaName(object):
+ """formula names"""
ARITHMETIC_MEAN = 'arithmetic mean'
WEIGHTED_ARITHMETIC_MEAN = 'weighted arithmetic mean'
GEOMETRIC_MEAN = 'geometric mean'
@@ -37,7 +37,7 @@ class PropName(object):
# spec
SECTIONS = 'sections'
WEIGHT = 'weight'
- ALGORITHM = 'algorithm'
+ FORMULA = 'formula'
METRICS = 'metrics'
WORKLOADS = 'workloads'
# plan
diff --git a/qtip/base/error.py b/qtip/base/error.py
index d364c532..01a7f7a6 100644
--- a/qtip/base/error.py
+++ b/qtip/base/error.py
@@ -21,3 +21,16 @@ class NotFound(QtipError):
def __init__(self, module, package='qtip'):
self.package = package
self.module = module
+
+
+class ToBeDoneError(QtipError):
+ """something still to be done"""
+ def __init__(self, method, module):
+ self.method = method
+ self.module = module
+
+
+def make_tbd(method, module='qtip'):
+ def tbd():
+ raise ToBeDoneError(method, module)
+ return tbd