aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/util
diff options
context:
space:
mode:
Diffstat (limited to 'qtip/util')
-rw-r--r--qtip/util/dev.py17
-rw-r--r--qtip/util/formula.py6
2 files changed, 20 insertions, 3 deletions
diff --git a/qtip/util/dev.py b/qtip/util/dev.py
new file mode 100644
index 00000000..b77bf1eb
--- /dev/null
+++ b/qtip/util/dev.py
@@ -0,0 +1,17 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
+from qtip.base.error import ToBeDoneError
+
+
+def create_to_be_done(method, module='qtip'):
+ def tbd():
+ raise ToBeDoneError(method, module)
+ return tbd
diff --git a/qtip/util/formula.py b/qtip/util/formula.py
index cdfbae86..e92d21f3 100644
--- a/qtip/util/formula.py
+++ b/qtip/util/formula.py
@@ -9,7 +9,7 @@
import numpy
-from qtip.base.error import make_tbd
+from qtip.util.dev import create_to_be_done
from qtip.base.constant import FormulaName
@@ -17,10 +17,10 @@ MAPPING = {
FormulaName.ARITHMETIC_MEAN: numpy.mean,
FormulaName.WEIGHTED_ARITHMETIC_MEAN: numpy.average,
# TODO(yujunz) find or implement the method
- FormulaName.GEOMETRIC_MEAN: make_tbd(FormulaName.GEOMETRIC_MEAN, __name__),
+ FormulaName.GEOMETRIC_MEAN: create_to_be_done(FormulaName.GEOMETRIC_MEAN, __name__),
# TODO(yujunz) find or implement the method
FormulaName.WEIGHTED_GEOMETRIC_MEAN:
- make_tbd(FormulaName.GEOMETRIC_MEAN, __name__)}
+ create_to_be_done(FormulaName.GEOMETRIC_MEAN, __name__)}
class Formula: