Repository: climate Updated Branches: refs/heads/master a8054c4af -> e4c5ccca3
CLIMATE-401 - Remove UnaryMetrics from UI settings menu Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8a461063 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8a461063 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8a461063 Branch: refs/heads/master Commit: 8a4610630e9681c0ffa822901ae0eff76a01c1f6 Parents: 0742e68 Author: Michael Joyce <[email protected]> Authored: Sun Apr 6 13:30:55 2014 -0700 Committer: Michael Joyce <[email protected]> Committed: Sun Apr 6 13:30:55 2014 -0700 ---------------------------------------------------------------------- ocw-ui/backend/processing.py | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/8a461063/ocw-ui/backend/processing.py ---------------------------------------------------------------------- diff --git a/ocw-ui/backend/processing.py b/ocw-ui/backend/processing.py index 5465d3a..2b70713 100644 --- a/ocw-ui/backend/processing.py +++ b/ocw-ui/backend/processing.py @@ -454,6 +454,12 @@ def _get_valid_metric_options(): :returns: A dictionary of metric (name, object) pairs ''' invalid_metrics = ['ABCMeta', 'Metric', 'UnaryMetric', 'BinaryMetric'] + + # Consider all Unary Metrics invalid. At the moment, the UI cannot handle + # running Unary Metrics. + unary_metrics = [cls.__name__ for cls in metrics.UnaryMetric.__subclasses__()] + invalid_metrics += unary_metrics + return {name:obj for name, obj in inspect.getmembers(metrics) if inspect.isclass(obj) and name not in invalid_metrics}
